WordPress filter hook
capability
Fired by 9 WordPress plugins, running on 890+ sites between them.
How to use capability
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'capability', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from Bayarcash WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
9 plugins that fire capability
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Bayarcash WooCommerce700+ installs
apply_filters( 'capability', 'manage_options' )includes/src/Bayarcash.php:363 -
SecurePay For WooCommerce100+ installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePay.php:70 -
Bayarcash GiveWP30+ installs
apply_filters( 'capability', 'manage_options' )includes/src/Bayarcash.php:135 -
SecurePay For Fluent Forms20+ installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePayFluentForms.php:34 -
SecurePay For GravityForms10+ installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePayGFM.php:34 -
SecurePay For GiveWP10+ installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePay_GiveWP.php:34 -
SecurePay For Paid Memberships Pro10+ installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePay_PMPro.php:34 -
SecurePay For WPForms10+ installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePay_WPForms.php:34 -
SecurePay For Restrict Content ProFewer than 10 installs
apply_filters( 'capability', 'manage_options' )includes/src/SecurePay_RCP.php:34
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.