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
2138           if ( ! $uid ) {
2139                /**
2140                 * Filters whether the user who generated the nonce is logged out.
2141                 *
2142                 * @since 3.5.0
2143                 *
2144                 * @param int    $uid    ID of the nonce-owning user.
2145                 * @param string $action The nonce action.
2146                 */
2147                $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2148           }
2149
2150           if ( empty( $nonce ) ) {
2151                return false;
2152           }
2153
2154           $token = wp_get_session_token();
2155           $i     = wp_nonce_tick();
2156
 
Line Code
2193       *
2194       * @param string|int $action Scalar value to add context to the nonce.
2195       * @return string The token.
2196       */
2197      function wp_create_nonce( $action = -1 ) {
2198           $user = wp_get_current_user();
2199           $uid  = (int) $user->ID;
2200           if ( ! $uid ) {
2201                /** This filter is documented in wp-includes/pluggable.php */
2202                $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2203           }
2204
2205           $token = wp_get_session_token();
2206           $i     = wp_nonce_tick();
2207
2208           return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
2209      }
2210 endif;
2211