Available since: 2.4.5
searchwp_dashboard_widget_cap
If you would like more control over who can see the SearchWP Dashboard Widget you can use this filter to modify the capability required to view it.
To change the capability required to view the SearchWP Dashboard Widget, 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_dashboard_widget_cap( $capability ) { | |
return 'edit_posts'; // Editors and up should be able to see the stats | |
} | |
add_filter( 'searchwp_dashboard_widget_cap', 'my_searchwp_dashboard_widget_cap' ); |