shortcodes[] = 'jwplayer'; } } /** * Analyse a video shortcode from the plugin for usable video information * * @param string $full_shortcode Full shortcode as found in the post content. * @param string $sc Shortcode found. * @param array $atts Shortcode attributes - already decoded if needed. * @param string $content The shortcode content, i.e. the bit between [sc]content[/sc]. * * @return array An array with the usable information found or else an empty array */ public function get_info_from_shortcode( $full_shortcode, $sc, $atts = array(), $content = '' ) { $vid = array(); if ( isset( $atts['mediaid'] ) ) { $mediaid = WPSEO_Video_Wrappers::yoast_wpseo_video_validate_int( $atts['mediaid'] ); if ( $mediaid !== false && $mediaid > 0 ) { $content_loc = wp_get_attachment_url( $mediaid ); // @todo should we maybe use JWP6_Plugin::url_from_post( $mediaid ) to stay in line ? if ( $content_loc !== false ) { $vid['content_loc'] = $content_loc; } $duration = get_post_meta( $mediaid, 'jwplayermodule_duration', true ); if ( $duration !== '' ) { $vid['duration'] = $duration; } $thumbnail_loc = get_post_meta( $mediaid, 'jwplayermodule_thumbnail_url', true ); if ( $thumbnail_loc !== '' ) { $vid['thumbnail_loc'] = $thumbnail_loc; } } unset( $mediaid, $content_loc, $duration, $thumbnail_loc ); } // @todo [JRF] Does this really belong with this plugin ? can't find documentation for this plugin on the html5_file or file attributes if ( ! isset( $vid['content_loc'] ) ) { if ( isset( $atts['html5_file'] ) && ( is_string( $atts['html5_file'] ) && $atts['html5_file'] !== '' ) ) { $vid['content_loc'] = $atts['html5_file']; } elseif ( isset( $atts['file'] ) && ( is_string( $atts['file'] ) && $atts['file'] !== '' ) ) { $vid['content_loc'] = $atts['file']; } if ( isset( $vid['content_loc'], $atts['image'] ) && ( is_string( $atts['image'] ) && $atts['image'] !== '' ) ) { $vid['thumbnail_loc'] = $atts['image']; } } if ( $vid !== array() ) { $vid['type'] = 'jwplayer'; // @todo - should this be added ? or should we believe the jwplayer plugin info to be good enough (though incomplete) ? // $vid['url'] = $vid['content_loc']; // $vid['maybe_local'] = true; $vid = $this->maybe_get_dimensions( $vid, $atts ); } return $vid; } } }