• Resolved psypat

    (@psypat)


    Hi, I have previous contacted you for this, and got this code:

    // Remove relevansi admin search for non admin
    add_filter( 'relevanssi_admin_search_capability', function( $cap ) {
      return 'edit_others_posts';
    } );
    // Remove relevansi admin search for non admin

    However, It’s not working anymore, the user role “contributor” can see& use it..

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    That should still work, assuming contributors have not received the edit_others_posts capability from somewhere.

    Thread Starter psypat

    (@psypat)

    Well, I’ve been testing publishpress https://publishpress.com/ , and they allow me to change almost everything, but they are not allowed to edit other posts..

    Maybe they are colliding somehow, is it possible to restrict the search function to only administrator, by name or userid?

    Plugin Author Mikko Saari

    (@msaari)

    It’s quite possible PublishPress would change the capabilities. This can only be controlled in Relevanssi with the capabilities. Perhaps you can try some other admin capability? Instead of edit_others_posts, try activate_plugins or switch_themes or something like that.

    Thread Starter psypat

    (@psypat)

    I’m not really sure how I solved it, but it works now, with the old code.. thanx for the help

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hide search for all except admin’ is closed to new replies.