1. Home
  2. Plugins
  3. WP Webhooks
  4. For Devs
  5. Filter
  6. Global Plugin Capability Filter
  1. Home
  2. For Devs
  3. Filter
  4. Global Plugin Capability Filter

Global Plugin Capability Filter

wpwhpro/admin/settings/capability

Description:
This filter allows you to rewrite the custom capability that is used for our plugin. In the default code it gets used for our main plugin page. You can customize the settings page capability for single tabs separately using the element tab settings filter.

Parameter Type Description
‘manage_options’ string This is the the custom capability itself
$target string This defines separately where the capability is called from. Default: ‘main’

/**
* Customize the globally uses capability for this plugin
*
* Important: Be aware that it is possibble, that you use different capabilities
* for the settings page based on the settings filter
*/
$cap = apply_filters('wpwhpro/admin/settings/capability', 'manage_options', $target);

Updated on August 10, 2019

Was this article helpful?

Related Articles