'; } return do_shortcode( $link ); } add_shortcode( 'download_video', 'aye_video_download' ); /** * Transcript Shortcode * * Shortcode to return YouTube transcripts * * @since 2.0 * * @uses aye_generate_transcript Generate the transcript * * @param string $paras Shortcode parameters * @param string $content Shortcode content * @return string Transcript XHTML */ function aye_transcript_sc( $paras = '', $content = '' ) { return do_shortcode( aye_generate_transcript( $content ) ); } add_shortcode( 'transcript', 'aye_transcript_sc' ); /** * Video Name Shortcode * * Shortcode to return the name of a YouTube video * * @since 2.0 * * @uses aye_extract_id Extract the video ID * @uses aye_validate_id Get the name and video type * @uses aye_error Return an error * * @param string $paras Shortcode parameters * @param string $content Shortcode content * @return string Video name */ function aye_video_name_shortcode( $paras = '', $content = '' ) { // Extract the ID if a full URL has been specified $id = aye_extract_id( $content ); // Check what type of video it is and whether it's valid $return = aye_validate_id( $id, true ); if ( !$return[ 'type' ] ) { return aye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) ); } if ( strlen( $return[ 'type' ] ) != 1 ) { return aye_error( $return[ 'type' ] ); } // Return the video title return do_shortcode( $return['title'] ); } add_shortcode( 'youtube_name', 'aye_video_name_shortcode' ); ?>