WordPress action hook · part of WordPress core
wp_before_execute_ability
A WordPress core action that 4 plugins also fire themselves, running on 60K+ sites between them.
“Fires before an ability gets executed, after input validation and permissions check.”
How to use wp_before_execute_ability
It's an action: your callback runs at that point and receives 2 arguments. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'wp_before_execute_ability', function( $name, $input ) {
// Your code runs here.
}, 10, 2 );Argument names come from wpDataTables's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
4 plugins that fire wp_before_execute_ability
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
wpDataTables60,000+ installs
do_action( 'wp_before_execute_ability', $this->name, $input )lib/wordpress/abilities-api/includes/abilities-api/class-wp-ability.php:596 -
ClearPost80+ installs
do_action( 'wp_before_execute_ability', $this->name, $input )lib/abilities-api/wordpress/abilities-api/includes/abilities-api/class-wp-ability.php:631 -
Airo WP AI Builder40+ installs
do_action( 'wp_before_execute_ability', $this->name, $input )dependencies/wordpress/abilities-api/includes/abilities-api/class-wp-ability.php:596 -
Cognitcxt AI Chat Assistant for WooCommerceFewer than 10 installs
do_action( 'wp_before_execute_ability', $this->name, $input )includes/abilities-api/abilities-api/class-wp-ability.php:631
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.