Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Video Post Type ID, Retrieve the post ID within the query loop
- $post_id = get_the_ID();
- $source = streamtube_core()->get()->post->get_source( $post_id );
- // OR $source = get_post_meta( $post_id, 'video_url', true );
- if( wp_attachment_is( 'video', $source ) ){
- // Source is a video attachment
- // Get playable url
- $source_url = wp_get_attachment_url( $source );
- }else{
- // Otherwise, source is an URL or embed/script code.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement