Filters whether to short-circuit ability execution.
Description
Returning a value other than the received default bypasses the rest of execute() — input normalization, input validation, permission checks, the registered execute callback, output validation, and the surrounding actions — and the value is returned to the caller as-is. Useful for cached responses, rate limiting, maintenance mode, and test mocking. To continue with normal execution, return $pre unchanged. This preserves any value (including null, false, or arbitrary objects) as a valid short-circuit result. Because validation is bypassed, callers that short-circuit are responsible for the integrity of any value they consume from $input.
Parameters
$premixed
The pre-computed result. Return this value unchanged to continue execution. Default WP_Filter_Sentinel instance unique to this invocation.
803* @param mixed$pre The pre-computed result.Return this value unchanged to continue execution.804*Default`WP_Filter_Sentinel` instance unique to this invocation.805* @param string$ability_name The name of the ability.806* @param mixed$input The raw input passed to `execute()`.807* @param WP_Ability$ability The ability instance.808*/809$pre=apply_filters('wp_pre_execute_ability',$pre_execute_sentinel,$this->name,$input,$this);810if($pre!==$pre_execute_sentinel){811return$pre;812}813814$input=$this->normalize_input($input);815if(is_wp_error($input)){
History
Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.