Using remove_filter to remove Related Posts if block is visible#11340
Using remove_filter to remove Related Posts if block is visible#11340aldavigdis merged 1 commit intomasterfrom
Conversation
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: February 14, 2019. |
jeherve
left a comment
There was a problem hiding this comment.
This works well! Merge when ready.
jeherve
left a comment
There was a problem hiding this comment.
Coming back to this, I think we may have to review that solution before we merge. It works well in Jetpack, but it won't work on WordPress.com where the Related Posts aren't hooked into the_content, but into post_flair.
I am not sure if we should handle this right here in the file that is synchronized with WordPress.com, or only on WordPress.com within the WPCOM_RelatedPosts that extends Jetpack_RelatedPosts. What do you think?
|
Hello there, This seems to be related to this ticket: Issue: Duplicate
1798315-zen |
|
@jeherve — Sorry about responding to this so late — Moving this conversation to the Phabricator side. |
|
Just to recap: Apparently, Jetpack_RelatedPosts assumes that there's a different class called WPCOM_RelatedPosts, which extends it and uses the post_flair filter instead. If this fixes things on the Jetpack side and does not affect WordPress.com sites, then I suggest we merge this as-is on both sides and do a WPCOM-only PR in Phabricator as a follow-up. |
Removes the Related Posts section that is added below the_content if a Related Posts block is already a part of the content. The current solution seems to be a CSS hack that does not work properly.
Testing instructions:
Proposed changelog entry for your changes:
If the Related Post block is a part of a post's content, the Related Posts section below it will now be removed for that post.