Description
Implements [bw_video] shortcode to display a video for attachments or other post types
Usage
bw_video( $atts );Parameters
- $atts
- ( array ) optional – shortcode parameters
Returns
voidSource
File name: oik-video/oik-video.incLines:
1 to 19 of 19
function bw_video( $atts=null ) { $url = bw_array_get( $atts, "url", null ); $width = bw_array_get( $atts, "width", null ); $height = bw_array_get( $atts, "height", null ); $class = bw_array_get( $atts, "class", "bw_video" ); $atts['rel'] = bw_array_get ( $atts, "rel", 0 ); if ( $url ) { if ( false === strpos( $url, "rel=" ) ) { $url = esc_url( add_query_arg( "rel", $atts['rel'], $url ) ); } $url = _bw_improve_url( $url ); sdiv( $class ); bw_movie( $url, $width, $height ); ediv(); } else { bw_attached_videos( $atts, $width, $height ); } return( bw_ret() ); }
Invoked by
Calls
1 to 7 of 7
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_attached_videos() – Displays attached videos
- bw_movie() – Embeds the video using iframe
- bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
- ediv() – End a div
- sdiv() – Start a div
- _bw_improve_url() – Improves YouTube URL
