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
2067           if ( ! $uid ) {
2068                /**
2069                 * Filters whether the user who generated the nonce is logged out.
2070                 *
2071                 * @since 3.5.0
2072                 *
2073                 * @param int    $uid    ID of the nonce-owning user.
2074                 * @param string $action The nonce action.
2075                 */
2076                $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2077           }
2078
2079           if ( empty( $nonce ) ) {
2080                return false;
2081           }
2082
2083           $token = wp_get_session_token();
2084           $i     = wp_nonce_tick();
2085
 
Line Code
2122       *
2123       * @param string|int $action Scalar value to add context to the nonce.
2124       * @return string The token.
2125       */
2126      function wp_create_nonce( $action = -1 ) {
2127           $user = wp_get_current_user();
2128           $uid  = (int) $user->ID;
2129           if ( ! $uid ) {
2130                /** This filter is documented in wp-includes/pluggable.php */
2131                $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2132           }
2133
2134           $token = wp_get_session_token();
2135           $i     = wp_nonce_tick();
2136
2137           return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
2138      }
2139 endif;
2140