Relevanssi - A Better Search
[resolved] Filter relevanssi_post_ok don't execute the function (2 posts)

  1. pawelkmpt
    Posted 3 years ago #

    I use Relevanssi 3.1.4 and I want to use relevanssi_post_ok filter to restrict post in search results for different access levels in WPMU Membership plugin.

    I added my function in functions.php but it's executed only for 2 of 4 member levels. Where could be a problem?

    add_filter( 'relevanssi_post_ok', 'check_post_user_access', 10, 2 );

    I also tried to change a priority in the filter but it didn't help.


  2. pawelkmpt
    Posted 3 years ago #

    After debugging the code of Relevanssi I found out that Membership plugin affects on search results. Defining rules for particular membership level automatically define search rules.

    If you define positive rule it means that searching will be only within those rules (eg. only in defined categories).

    If you define negative rule it means that searching will be everywhere, but not within those rules (eg. everywhere but not in disallowed categories).

    So it wasn't fault of Relevanssi but Membership plugin. But they don't mentioned anything about search results...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic