logout_url
Filters the logout URL.
Description
Parameters (2)
- 0. $logout_url (string)
- The HTML-encoded logout URL.
- 1. $redirect (string)
- Path to redirect to on logout.
Usage
- To run the hook, copy the example below.
- $logout_url = apply_filters( 'logout_url', $logout_url, $redirect );
- if ( !empty( $logout_url ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the logout_url callback
- function filter_logout_url( $logout_url, $redirect ) {
- // make filter magic happen here...
- return $logout_url;
- };
- // add the filter
- add_filter( 'logout_url', 'filter_logout_url', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'logout_url', 'filter_logout_url', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/general-template.php
- return apply_filters( 'logout_url', $logout_url, $redirect );