wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_pre_execute_ability › WordPress Filter Hooks

Since7.1.0
Deprecatedn/a
apply_filters( 'wp_pre_execute_ability', $pre_execute_sentinel, $this->name, $input, $this )
Parameters: (4)
  • () pre The pre-computed result. Return this value unchanged to continue execution. Default `WP_Filter_Sentinel` instance unique to this invocation.
    Required: Yes
  • () ability_name The name of the ability.
    Required: Yes
  • () input The raw input passed to `execute()`.
    Required: Yes
  • () ability The ability instance.
    Required: Yes
Defined at:
Codex:

Filters whether to short-circuit ability execution.

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`.




Source

$pre                  = apply_filters( 'wp_pre_execute_ability', $pre_execute_sentinel, $this->name, $input, $this );