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
1832      if ( ! $uid ) {
1833           /**
1834            * Filter whether the user who generated the nonce is logged out.
1835            *
1836            * @since 3.5.0
1837            *
1838            * @param int    $uid    ID of the nonce-owning user.
1839            * @param string $action The nonce action.
1840            */
1841           $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1842      }
1843
1844      if ( empty( $nonce ) ) {
1845           return false;
1846      }
1847
1848      $token = wp_get_session_token();
1849      $i = wp_nonce_tick();
1850
 
Line Code
1887  *
1888  * @param string|int $action Scalar value to add context to the nonce.
1889  * @return string The token.
1890  */
1891 function wp_create_nonce($action = -1) {
1892      $user = wp_get_current_user();
1893      $uid = (int) $user->ID;
1894      if ( ! $uid ) {
1895           /** This filter is documented in wp-includes/pluggable.php */
1896           $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
1897      }
1898
1899      $token = wp_get_session_token();
1900      $i = wp_nonce_tick();
1901
1902      return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
1903 }
1904 endif;
1905