Filters the result of an ability's permission check.
Description
Fires after the registered permission_callback returns. Plugins can use this to layer additional authorization rules on top of the ability's own permission logic — for example, multi-factor authorization gates or temporary permission elevation for trusted contexts. Filters can return true to grant, false to deny, or a WP_Error to deny with a specific error code and message. The filter receives whatever the permission_callback produced.Any other return value is coerced to false.
Parameters
$permissionbool|WP_Error
The permission result returned by permission_callback.
646*647* @param bool|WP_Error$permission The permission result returned by `permission_callback`.648* @param string$ability_name The name of the ability.649* @param mixed$input The input data for the permission check.650* @param WP_Ability$ability The ability instance.651*/652$result=apply_filters('wp_ability_permission_result',$permission,$this->name,$input,$this);653if(!is_bool($result)&&!is_wp_error($result)){654$result=false;655}656return$result;657}658
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.