WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/logout url

Description

logout_url is a filter applied to the url returned by the function wp_logout_url()

Parameters

$logout_url
(string) (required) The URL for logout.
Default: None
$redirect
(string) (optional) The URL to redirect back to upon successful logout.
Default: None

Examples

add_filter( 'logout_url', 'my_logout_page', 10, 2 );
function my_logout_page( $logout_url, $redirect ) {
    return home_url( '/my-logout-page/?redirect_to=' . $redirect );
}

Change Log

Since: Version 2.8

Source File

logout_url is located in wp-includes/general-template.php

Related