Logout redirect

Overview

Configure the destination after logout. Select the subject with AAM::api()->logout_redirect($access_level, $settings). Omit $access_level to use the current user or visitor.

PHP class: AAM_Framework_Service_LogoutRedirect.

Method reference

Method Purpose
get_redirect() Read the effective redirect.
set_redirect(array $redirect) Store a redirect model.
reset() Remove one rule or all rules for this level.
is_customized() Check for a direct rule or preference.

Return values vary by method. Rule updates usually return bool; reads can return a value, null, or an array. Errors follow the service’s error_handling setting and may produce WP_Error.

Accepted identifiers

This service has no resource identifier. set_redirect() takes a redirect model array for the selected access level; get_redirect() and reset() take no target. See the example below for the model shape.

Example

$redirect = AAM::api()->logout_redirect('role:subscriber');
$redirect->set_redirect([
    'type' => 'url_redirect',
    'redirect_url' => '/'
]);

After a Subscriber signs out, AAM sends the browser to the site root (/).

Developer notes

Behavior and parameters