• Hi,

    I’m using the plugin to restrict items that are CPT.
    The problem is, it does work correctly with search results (hides restricted item) but not with taxonomy archives (doesn’t hide restricted item).
    Where do I even start troubleshooting this? ??

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Nazar Hotsa

    (@bugnumber9)

    Interesting observation.
    I’ve been messing around with plugin code in /groups/lib/access/class-groups-post-access.php

    When I remove if condition before line 95:
    add_filter( 'the_posts', array( __CLASS__, 'the_posts' ), 1, 2 );
    it kinda starts working.
    I mean the protected item gets hidden on taxonomy archive page, but taxonomy grid with pagination gets broken – it displays 1 empty spot on the page where the restricted item used to show up.

    Plugin Author Kento

    (@proaktion)

    Hi Nazar,

    … not with taxonomy archives (doesn’t hide restricted item).

    If you have protected entries popping up in taxonomy archives, then what you use to display the entries seems to be overriding access restrictions. Probably a direct database query instead of using a WP_Query, or a WP_Query with filters not applies. I would look into the template and any customizations you’re using on how the post type archives are displayed.

    Cheers

    Thread Starter Nazar Hotsa

    (@bugnumber9)

    That’s what I thought too, but taxonomy archives do use WP_Query.
    I went with a different solution for now (WooCommerce Memberships) which does the job.
    Would you be interested to check the issue on your end? I can send you a theme archive for testing if that’s something you’d like to dig into ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restricted item hidden in search results but not in taxonomy archive’ is closed to new replies.