Skip to content

Commit

Permalink
Related Posts: Do not add related posts to excerpts
Browse files Browse the repository at this point in the history
Fixes #13273

Check the $wp_current_filter array for 'get_the_excerpt' using
doing_filter() to ensure that related posts aren't added to excerpts.
  • Loading branch information
kbrown9 committed Aug 21, 2019
1 parent aeac504 commit 9fa6348
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/related-posts/jetpack-related-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function filter_add_target_to_dom( $content ) {
return $content;
}

if ( ! $this->_found_shortcode ) {
if ( ! $this->_found_shortcode && ! doing_filter( 'get_the_excerpt' ) ) {
if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() ) {
$content .= "\n" . $this->get_server_rendered_html();
} else {
Expand Down

0 comments on commit 9fa6348

Please sign in to comment.