jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Related Posts: Enable filter no longer functional

Open leandroprz opened this issue 7 years ago • 9 comments

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.

leandroprz avatar Mar 12 '19 01:03 leandroprz

This was caused by #11220

kraftbj avatar Mar 13 '19 20:03 kraftbj

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!

kraftbj avatar Mar 13 '19 20:03 kraftbj

1866967-zen

interlineae avatar Mar 16 '19 14:03 interlineae

1883841-zen

a8ck3n avatar Mar 18 '19 10:03 a8ck3n

1893096-zen

aheckler avatar Mar 20 '19 13:03 aheckler

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.

KokkieH avatar Mar 25 '19 05:03 KokkieH

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 avatar Apr 08 '19 22:04 macmanx2

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.

leandroprz avatar Apr 09 '19 21:04 leandroprz

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 avatar Dec 30 '19 21:12 kbrown9