Created
March 28, 2014 13:18
-
-
Save jdevalk/9832491 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Make the `vc_raw_html` shortcodes content available to the video seo plugin for indexing. | |
* | |
* @param string $content The post content | |
* | |
* @return string | |
*/ | |
function yst_make_raw_html_detectable( $content ) { | |
preg_match_all( '/(\[vc_raw_html\](.*)\[\/vc_raw_html\])?/', $content, $matches, PREG_SET_ORDER ); | |
foreach ( $matches as $match ) { | |
if ( isset( $matches[2] ) ) { | |
$content = str_replace( $match[0], urldecode( base64_decode( $match[2] ) ), $content ); | |
} | |
} | |
return $content; | |
} | |
add_filter( 'wpseo_video_index_content', 'yst_make_raw_html_detectable' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment