apply_filters( ‘wp_ability_permission_result’, bool|WP_Error $permission, string $ability_name, mixed $input, WP_Ability $ability )

In this article

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.
$ability_namestring
The name of the ability.
$inputmixed
The input data for the permission check.
$abilityWP_Ability
The ability instance.

Source

$result = apply_filters( 'wp_ability_permission_result', $permission, $this->name, $input, $this );

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.