Skip to content

Instantly share code, notes, and snippets.

@gdarko
Created February 19, 2024 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdarko/f4f29281ecdcee506c0ea28f5ffae6ad to your computer and use it in GitHub Desktop.
Save gdarko/f4f29281ecdcee506c0ea28f5ffae6ad to your computer and use it in GitHub Desktop.
Query uploaded videos
<?php
// Loop videos
$database = new WP_DGV_Db_Helper();
$videos = $database->get_videos([
'author' => 'USER_ID_GOES_HERE',
'posts_per_page' => 5,
'paged' => 1,
]);
foreach($videos as $video) {
$video_url = $database->get_vimeo_link($video->ID);
echo '<iframe src="'.$video_url.'" width="420" height="240"></iframe>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment