Advertisement
arie_cristianD

change post format to video

Mar 26th, 2024 (edited)
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. /* change the $jeg_post_id and $jeg_video_source with the actual value from wpAutomatic plugin */
  2.  
  3.  
  4. $jeg_post_id      = 112330;
  5. $jeg_video_source = '<iframe width="560" height="315" src="https://www.youtube.com/embed/VzwmVzpAQbs?si=ZySYcZ2Kf0tl1-d0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>';
  6.  
  7.  
  8. set_post_format( $jeg_post_id, 'video' ); /* to change post format to video */
  9. update_post_meta( $jeg_post_id, '_format_video_embed', $jeg_video_source ); /* to change the video source url/embed code */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement