Remove Jetpack Related Posts from Woo Testimonials
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 | |
/** | |
* Remove Jetpack Related Posts from Woo Testimonials shortcode | |
* | |
* @see http://jetpack.me/support/related-posts/customize-related-posts/#delete | |
* | |
* @param string $content | |
* @return string $content | |
*/ | |
function sha_jetpackme_remove_rp( $content ) { | |
// Get the Jetpack Related Posts instance | |
$jprp = Jetpack_RelatedPosts::init(); | |
$callback = array( $jprp, 'filter_add_target_to_dom' ); | |
// Only remove it from the woo_testimonials the_content filter | |
if ( 'testimonial' === get_post_type() ) { | |
remove_filter( 'the_content', $callback, 40 ); | |
} | |
return $content; | |
} | |
add_filter( 'the_content', 'sha_jetpackme_remove_rp', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment