invp_get_the_youtube_url( int|null $post_ID = null )
Returns this vehicle’s YouTube video URL or empty string.
Parameters
- $post_ID
-
(int|null) (Optional) The post ID of a vehicle. Must be passed when using this method outside the loop.
Default value: null
Return
(string) This vehicle's YouTube URL or empty string
Source
File: includes/template-tags.php
function invp_get_the_youtube_url( $post_ID = null ) { if ( empty( $post_ID ) ) { $post_ID = get_the_ID(); } $video_id = INVP::get_meta( 'youtube', $post_ID ); if ( empty( $video_id ) ) { return ''; } return 'https://www.youtube.com/watch?v=' . $video_id; }
Expand full source code Collapse full source code View on Github