Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: loginout

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
211  * @return string|null String when retrieving, null when displaying.
212  */
213 function wp_loginout($redirect = '', $echo = true) {
214      if ( ! is_user_logged_in() )
215           $link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
216      else
217           $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
218
219      if ( $echo )
220           echo apply_filters('loginout', $link);
221      else
222           return apply_filters('loginout', $link);
223 }
224
225 /**
226  * Returns the Log Out URL.
227  *
228  * Returns the URL that allows the user to log out of the site.
229  *
230  * @since 2.7.0
231  * @uses wp_nonce_url() To protect against CSRF.