WordPress.org

Ready to get started?Download WordPress

Codex

Plugin API/Filter Reference/logout url

Contents

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) (required) The URL to redirect back to upon successful logout
Default: None

Examples

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

Change Log

Since: Version 2.8

Source Files

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

Related