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
1698      if ( ! $uid ) {
1699           /**
1700            * Filter whether the user who generated the nonce is logged out.
1701            *
1702            * @since 3.5.0
1703            *
1704            * @param int    $uid    ID of the nonce-owning user.
1705            * @param string $action The nonce action.
1706            */
1707           $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1708      }
1709
1710      if ( empty( $nonce ) ) {
1711           return false;
1712      }
1713
1714      $token = wp_get_session_token();
1715      $i = wp_nonce_tick();
1716
 
Line Code
1739  *
1740  * @param string $action Scalar value to add context to the nonce.
1741  * @return string The token.
1742  */
1743 function wp_create_nonce($action = -1) {
1744      $user = wp_get_current_user();
1745      $uid = (int) $user->ID;
1746      if ( ! $uid ) {
1747           /** This filter is documented in wp-includes/pluggable.php */
1748           $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1749      }
1750
1751      $token = wp_get_session_token();
1752      $i = wp_nonce_tick();
1753
1754      return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
1755 }
1756 endif;
1757