Available since: 2.1
searchwp_settings_cap
View Parameters »With this hook you can control who has access to view the SearchWP settings screen.
Please note that the WordPress Settings API restricts saving settings to users with the manage_options
capability.
If you would like to give users access to view the SearchWP settings and in turn access to the Advanced settings you can add something like the following to your theme’s functions.php
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_settings_cap( $capability ) { | |
return 'edit_posts'; // Editors and up | |
} | |
add_filter( 'searchwp_settings_cap', 'my_searchwp_settings_cap' ); |
Parameters
Parameter | Type | Description |
---|---|---|
$capability |
String |
By default access is restricted to Users with the |