Skip to content
Snippets Groups Projects
Commit be829e7c authored by lucha's avatar lucha
Browse files

ai-embed: removed youtube handlers since it's in the wordpress core since 4.0

parent 6311b110
Branches
Tags
No related merge requests found
......@@ -7,7 +7,11 @@
* Author: lechuck, lucha
* Author URI: http://noblogs.org
**/
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
/* Starting from wordpress 4.0, there is a function in the core called wp_embed_handler_youtube
* that takes care of forcing https. http://wpseek.com/wp_embed_handler_youtube/
*/
/*function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
$width = ($rawattr['width']) ? $rawattr['width'] : 340 ;
$height = ($rawattr['height']) ? $rawattr['height'] : 560 ;
if (is_ssl()) {
......@@ -19,7 +23,7 @@ $embed = sprintf(
'<object height="%2$s" width="%3$s"><param name="movie" value="%1$s?fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="%1$s?fs=1" type="application/x-shockwave-flash" width="%2$s" height="%3$s" allowscriptaccess="always" allowfullscreen="true"></embed></object>',esc_attr($ret_url),esc_attr($height),esc_attro($width));
return apply_filters( 'embed_youtube', $embed, $matches, $attr, $url, $rawattr );
}
} */
function wp_embed_handler_google_maps( $matches, $attr, $url, $rawattr ) {
$width = ($rawattr['width']) ? $rawattr['width'] : 425 ;
......@@ -199,7 +203,7 @@ function register_embed_handlers() {
wp_embed_register_handler( 'ogm', '#http://.*?/.*?ogm#i', 'wp_embed_handler_ogm' );
wp_embed_register_handler( 'archive', '#http://(.+\.)?archive.org/.*/.*\.(mp4|wmv|mov|mp3|ogv)#i', 'wp_embed_handler_archive' );
wp_embed_register_handler( 'umapper', '#http://umapper.s3.amazonaws.com/.*?\.kml#i', 'wp_embed_handler_umapper' );
wp_embed_register_handler( 'youtube', '#http://(www\.)?youtube\.com/v/.*?#i', 'wp_embed_handler_youtube' );
// wp_embed_register_handler( 'youtube', '#http://(www\.)?youtube\.com/v/.*?#i', 'wp_embed_handler_youtube' );
wp_embed_register_handler( 'jamendo', '#http://www\.jamendo\.com/.*/(album|track)/(.*)#i', 'wp_embed_handler_jamendo' );
wp_embed_register_handler( 'dctptv', '#http://www.dctp.tv/embed/.*?/#i', 'wp_embed_handler_dctptv' );
wp_embed_register_handler( 'googlemaps', '#http(s)?://maps\.google\.[^\.]+/(.*)#i', 'wp_embed_handler_google_maps');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment