WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
2088 | if ( ! $uid ) { |
2089 | /** |
2090 | * Filters whether the user who generated the nonce is logged out. |
2091 | * |
2092 | * @since 3.5.0 |
2093 | * |
2094 | * @param int $uid ID of the nonce-owning user. |
2095 | * @param string $action The nonce action. |
2096 | */ |
2097 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
2098 | } |
2099 |
|
2100 | if ( empty( $nonce ) ) { |
2101 | return false; |
2102 | } |
2103 |
|
2104 | $token = wp_get_session_token(); |
2105 | $i = wp_nonce_tick(); |
2106 |
|
Line | Code |
2143 | * |
2144 | * @param string|int $action Scalar value to add context to the nonce. |
2145 | * @return string The token. |
2146 | */ |
2147 | function wp_create_nonce( $action = -1 ) { |
2148 | $user = wp_get_current_user(); |
2149 | $uid = (int) $user->ID; |
2150 | if ( ! $uid ) { |
2151 | /** This filter is documented in wp-includes/pluggable.php */ |
2152 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
2153 | } |
2154 |
|
2155 | $token = wp_get_session_token(); |
2156 | $i = wp_nonce_tick(); |
2157 |
|
2158 | return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); |
2159 | } |
2160 | endif; |
2161 |
|