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
2197           if ( ! $uid ) {
2198                /**
2199                 * Filters whether the user who generated the nonce is logged out.
2200                 *
2201                 * @since 3.5.0
2202                 *
2203                 * @param int    $uid    ID of the nonce-owning user.
2204                 * @param string $action The nonce action.
2205                 */
2206                $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2207           }
2208
2209           if ( empty( $nonce ) ) {
2210                return false;
2211           }
2212
2213           $token = wp_get_session_token();
2214           $i     = wp_nonce_tick();
2215
 
Line Code
2252       *
2253       * @param string|int $action Scalar value to add context to the nonce.
2254       * @return string The token.
2255       */
2256      function wp_create_nonce( $action = -1 ) {
2257           $user = wp_get_current_user();
2258           $uid  = (int) $user->ID;
2259           if ( ! $uid ) {
2260                /** This filter is documented in wp-includes/pluggable.php */
2261                $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
2262           }
2263
2264           $token = wp_get_session_token();
2265           $i     = wp_nonce_tick();
2266
2267           return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
2268      }
2269 endif;
2270