Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created March 28, 2014 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdevalk/9832491 to your computer and use it in GitHub Desktop.
Save jdevalk/9832491 to your computer and use it in GitHub Desktop.
<?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