Viewing 1 replies (of 1 total)
  • Thread Starter Andy McCoy

    (@andymax)

    Something like this:

    function amx_itunes_parse_oembed($content, $post) {
    	preg_match('/(https:|https:)\/\/itunes\.apple\.com\/.?.?\/album\/.*\/id(.*)\?.*/i', $content, $matches);
    	if(count($matches) > 0) {
    		$oembed = wp_oembed_get($matches[0]);
    		$content = preg_replace(
    			'/(https:|https:)\/\/itunes\.apple\.com\/.?.?\/album\/.*\/id(.*)\?.*/i',
    			$oembed,
    			$content,
    			1
    		);
    	}
    	return $content;
    }
    add_filter('wpseo_pre_analysis_post_content', 'amx_itunes_parse_oembed', 10, 2);

Viewing 1 replies (of 1 total)
  • The topic ‘IMG OpenGraph parsing of oEmbed content’ is closed to new replies.