aam_post_permission_result_filter
Purpose
Override a post permission decision.
Callback
- Type: Filter.
- Arguments:
$result,$permission_data(usually a permission array),$post(WP_Post),$permission(permission name). - Return: the filtered first argument.
Example
add_filter('aam_post_permission_result_filter', function ($result, $permission_data, $post, $permission) {
if ($post instanceof WP_Post && $post->ID === 42 && $permission === 'read') {
return true;
}
return $result;
}, 10, 4);
This forces a read restriction for post 42. The first argument can vary by permission method; inspect the caller before replacing it in production.
See the complete hook list.