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

Line Code
142  *
143  * @param string $redirect Optional path to redirect to on login/logout.
144  */
145 function wp_loginout($redirect = '') {
146      if ( ! is_user_logged_in() )
147           $link = '<a href="' . esc_url( wp_login_url($redirect) ) . '">' . __('Log in') . '</a>';
148      else
149           $link = '<a href="' . esc_url( wp_logout_url($redirect) ) . '">' . __('Log out') . '</a>';
150
151      echo apply_filters('loginout', $link);
152 }
153
154 /**
155  * Returns the Log Out URL.
156  *
157  * Returns the URL that allows the user to log out of the site
158  *
159  * @since 2.7
160  * @uses wp_nonce_url() To protect against CSRF