Support » Plugin: Groups » Restricted item hidden in search results but not in taxonomy archive

  • Nazar Hotsa



    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? ๐Ÿ™‚


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


    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


    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.


    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)
  • You must be logged in to reply to this topic.