• Resolved gavin310

    (@gavin310)


    Even when “Use Relevanssi for admin searches.” is unchecked the “User searches” and “Admin search” menu items show under Dashboard for Administrators and Editors. Is this correct behavior? We’re using the latest version.

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

    (@msaari)

    Yes. The “Use Relevanssi for admin searches” setting only applies to the search in the “Posts” list.

    To control who sees “User searches”, use the relevanssi_user_searches_capability hook. The default capability here is edit_pages. For “Admin searches”, the hook is relevanssi_admin_search_capability and the default setting is edit_posts. If you want only Administrators to see these features, set the capability to update_plugins:

    add_filter( 'relevanssi_user_searches_capability', function() { return 'update_plugins'; } );
    add_filter( 'relevanssi_admin_search_capability', function() { return 'update_plugins'; } );

    You can’t hide the features from admins this way. You can unhook

    add_action( 'admin_menu', 'relevanssi_menu' );

    But this will also remove the Relevanssi settings page.

    Thread Starter gavin310

    (@gavin310)

    Thank you! The filters worked great.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Admin search always showing’ is closed to new replies.