Created
April 28, 2022 18:20
-
-
Save wpmu-authors/f37da0cbf364a6d868884797e59455f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wp_embed_register_handler( 'forbes', '#http://(?:www|video)\.forbes\.com/(?:video/embed/embed\.html|embedvideo/)\?show=([\d]+)&format=frame&height=([\d]+)&width=([\d]+)&video=(.+?)($|&)#i', 'wp_embed_handler_forbes' ); | |
function wp_embed_handler_forbes( $matches, $attr, $url, $rawattr ) { | |
$embed = sprintf( | |
'<iframe src="http://www.forbes.com/video/embed/embed.html?show=%1$s&format=frame&height=%2$s&width=%3$s&video=%4$s&mode=render" width="%3$spx" height="%2$spx" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>', | |
esc_attr($matches[1]), | |
esc_attr($matches[2]), | |
esc_attr($matches[3]), | |
esc_attr($matches[4]) | |
); | |
return apply_filters( 'embed_forbes', $embed, $matches, $attr, $url, $rawattr ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment