aam_access_denied_redirect_handler_filter

Purpose

Supply a custom access-denied redirect handler.

Callback

Example

add_filter('aam_access_denied_redirect_handler_filter', function ($handler) {
    return function () {
        wp_die('Access denied', 'Access denied', ['response' => 403]);
    };
}, 10, 1);

Supplies a callable for the access-denied response. AAM invokes it and then exits; constrain this globally applied handler as needed.

See the complete hook list.