1. Home
  2. Development
  3. Hooks
  4. Filters
  5. Global Plugin Capability Filter

Global Plugin Capability Filter

awpa/admin/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, as well as for the custom element settings page. You can customize the settings page capability separately using the element page settings filter.

Parameter Type Description
‘manage_options’ string This is the slug of the custom capability
$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
         * in allwpaddons/admin/includes/partials/awpa-addon-settings-display.php
         */
        $cap = apply_filters('awpa/admin/capability', 'manage_options', $target); 
 
Updated on February 16, 2018

Was this article helpful?

Related Articles