WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 183 | * @param boolean $echo Default to echo and not return the link. |
| 184 | */ |
| 185 | function wp_loginout($redirect = '', $echo = true) { |
| 186 | if ( ! is_user_logged_in() ) |
| 187 | $link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>'; |
| 188 | else |
| 189 | $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>'; |
| 190 | |
| 191 | if ( $echo ) |
| 192 | echo apply_filters('loginout', $link); |
| 193 | else |
| 194 | return apply_filters('loginout', $link); |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Returns the Log Out URL. |
| 199 | * |
| 200 | * Returns the URL that allows the user to log out of the site |
| 201 | * |
| 202 | * @since 2.7 |
| 203 | * @uses wp_nonce_url() To protect against CSRF |