Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related Posts: Enable filter no longer functional #11546

Closed
leandroprz opened this issue Mar 12, 2019 · 9 comments · Fixed by #11560
Closed

Related Posts: Enable filter no longer functional #11546

leandroprz opened this issue Mar 12, 2019 · 9 comments · Fixed by #11560
Assignees
Labels
[Feature] Related Posts [Pri] High [Type] Bug When a feature is broken and / or not performing as intended

Comments

@leandroprz
Copy link

Steps to reproduce the issue

I added this custom code long ago to hide related posts in WooCommerce products. It was taken from here: https://jetpack.com/support/related-posts/customize-related-posts/

function exclude_jetpack_related_from_products( $options ) {
if ( is_product() ) {
$options['enabled'] = false;
}
 
return $options;
}
 
add_filter( 'jetpack_relatedposts_filter_options', 'exclude_jetpack_related_from_products' );

It was working perfectly until the few latest updates of Jetpack.

What I expected

Not to see related posts in WooCommerce product pages.

What happened instead

I see related posts in WooCommerce product pages.

@kraftbj kraftbj changed the title Can't hide related posts on WooCommerce product pages Related Posts: Enable filter no longer functional Mar 13, 2019
@kraftbj kraftbj added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Related Posts labels Mar 13, 2019
@kraftbj kraftbj added this to the 7.2 milestone Mar 13, 2019
@kraftbj
Copy link
Contributor

kraftbj commented Mar 13, 2019

This was caused by #11220

@kraftbj
Copy link
Contributor

kraftbj commented Mar 13, 2019

Other reports in https://wordpress.org/support/topic/jetpack-related-posts-filter-for-turning-off-related-posts-broken-i-wp-5-x/

We'll discuss fixing this up in #11560. Thank you for reporting the issue!

@anaemnesis
Copy link

1866967-zen

@a8ck3n
Copy link
Contributor

a8ck3n commented Mar 18, 2019

1883841-zen

@aheckler
Copy link
Member

1893096-zen

@KokkieH
Copy link

KokkieH commented Mar 25, 2019

Possibly another case in https://wordpress.org/support/topic/cant-restrict-related-posts-to-only-48-hours, though I'm not sure as that case uses the jetpack_relatedposts_filter_date_range filter rather than jetpack_relatedposts_filter_options. But the behaviour appears to be the same - the filter is not having any effect even though it's correct from what I can see.

@macmanx2
Copy link
Contributor

macmanx2 commented Apr 8, 2019

Two users are reporting this is still a problem after Jetpack 7.2: https://wordpress.org/support/topic/jetpack-related-posts-filter-for-turning-off-related-posts-broken-i-wp-5-x/#post-11388282

Any ideas?

@macmanx2 macmanx2 reopened this Apr 8, 2019
@jeherve jeherve modified the milestones: 7.2, 7.3 Apr 9, 2019
@leandroprz
Copy link
Author

leandroprz commented Apr 9, 2019

Two users are reporting this is still a problem after Jetpack 7.2: https://wordpress.org/support/topic/jetpack-related-posts-filter-for-turning-off-related-posts-broken-i-wp-5-x/#post-11388282

Any ideas?

v7.2 doesn't appear on my updates page, so I can't test this yet.

@kraftbj kraftbj modified the milestones: 7.3, 7.4 May 6, 2019
@jeherve jeherve removed this from the 7.4 milestone May 24, 2019
@aldavigdis aldavigdis removed their assignment Aug 28, 2019
@kbrown9
Copy link
Member

kbrown9 commented Dec 30, 2019

Two users are reporting this is still a problem after Jetpack 7.2: https://wordpress.org/support/topic/jetpack-related-posts-filter-for-turning-off-related-posts-broken-i-wp-5-x/#post-11388282

Any ideas?

These users reported that the filter correctly removed the related posts items, but the related posts headline was still displayed. I was able to reproduce the headline issue with version 7.2, and it appears to be fixed by PR #12020 in version 7.3. So, this issue can be closed.

One user reported a problem with duplicate jp-relatedposts div elements. I haven’t been able to reproduce that problem, and I think it's unrelated to this issue.

@kbrown9 kbrown9 closed this as completed Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Related Posts [Pri] High [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants