SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

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