Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: nonce_user_logged_out

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
1982      if ( ! $uid ) {
1983           /**
1984            * Filters whether the user who generated the nonce is logged out.
1985            *
1986            * @since 3.5.0
1987            *
1988            * @param int    $uid    ID of the nonce-owning user.
1989            * @param string $action The nonce action.
1990            */
1991           $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1992      }
1993
1994      if ( empty( $nonce ) ) {
1995           return false;
1996      }
1997
1998      $token = wp_get_session_token();
1999      $i = wp_nonce_tick();
2000
 
Line Code
2037  *
2038  * @param string|int $action Scalar value to add context to the nonce.
2039  * @return string The token.
2040  */
2041 function wp_create_nonce($action = -1) {
2042      $user = wp_get_current_user();
2043      $uid = (int) $user->ID;
2044      if ( ! $uid ) {
2045           /** This filter is documented in wp-includes/pluggable.php */
2046           $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2047      }
2048
2049      $token = wp_get_session_token();
2050      $i = wp_nonce_tick();
2051
2052      return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
2053 }
2054 endif;
2055