apply_filters( 'logout_url', string $logout_url, string $redirect )

Filters the logout URL.


Parameters Parameters

$logout_url

(string) The HTML-encoded logout URL.

$redirect

(string) Path to redirect to on logout.


Top ↑

More Information More Information

This filter is applied to the url returned by the function wp_logout_url().


Top ↑

Source Source

File: wp-includes/general-template.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by stevenlinx

    Example migrated from Codex:

    The following example changes the logout URL to a URL path relative to the home URL while keeping the same redirect URL.

    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 );
    }
    

You must log in before being able to contribute a note or feedback.