Note: You are viewing the documentation for Version 4View Version 3 Docs

searchwp\statistics\capability

Since: 4.0.0

Table of Contents

Control the Capability necessary to view SearchWP’s Statistics.

Parameters

Type Parameter Default Since
String $capability 'edit_others_posts' 4.0.0

Examples

All hooks should be added to your custom SearchWP Customizations Plugin.

Restrict viewing Statistics to Administrators

<?php
// Restrict viewing Statistics to Administrators in SearchWP.
add_filter( 'searchwp\statistics\capability', function( $capability ) {
return 'manage_options';
} );

How to use this code

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP