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:

functions.php
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.

  1. Bayarcash WooCommerce icon Bayarcash WooCommerce700+ installs apply_filters( 'capability', 'manage_options' ) includes/src/Bayarcash.php:363
  2. SecurePay For WooCommerce icon SecurePay For WooCommerce100+ installs apply_filters( 'capability', 'manage_options' ) includes/src/SecurePay.php:70
  3. Bayarcash GiveWP icon Bayarcash GiveWP30+ installs apply_filters( 'capability', 'manage_options' ) includes/src/Bayarcash.php:135
  4. SecurePay For Fluent Forms icon SecurePay For Fluent Forms20+ installs apply_filters( 'capability', 'manage_options' ) includes/src/SecurePayFluentForms.php:34
  5. SecurePay For GravityForms icon SecurePay For GravityForms10+ installs apply_filters( 'capability', 'manage_options' ) includes/src/SecurePayGFM.php:34
  6. SecurePay For GiveWP icon SecurePay For GiveWP10+ installs apply_filters( 'capability', 'manage_options' ) includes/src/SecurePay_GiveWP.php:34
  7. SecurePay For Paid Memberships Pro icon SecurePay For Paid Memberships Pro10+ installs apply_filters( 'capability', 'manage_options' ) includes/src/SecurePay_PMPro.php:34
  8. SecurePay For WPForms icon SecurePay For WPForms10+ installs apply_filters( 'capability', 'manage_options' ) includes/src/SecurePay_WPForms.php:34
  9. SecurePay For Restrict Content Pro icon 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.