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 |
---|---|
2182 | if ( ! $uid ) { |
2183 | /** |
2184 | * Filters whether the user who generated the nonce is logged out. |
2185 | * |
2186 | * @since 3.5.0 |
2187 | * |
2188 | * @param int $uid ID of the nonce-owning user. |
2189 | * @param string $action The nonce action. |
2190 | */ |
2191 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
2192 | } |
2193 |
|
2194 | if ( empty( $nonce ) ) { |
2195 | return false; |
2196 | } |
2197 |
|
2198 | $token = wp_get_session_token(); |
2199 | $i = wp_nonce_tick(); |
2200 |
|
Line | Code |
2237 | * |
2238 | * @param string|int $action Scalar value to add context to the nonce. |
2239 | * @return string The token. |
2240 | */ |
2241 | function wp_create_nonce( $action = -1 ) { |
2242 | $user = wp_get_current_user(); |
2243 | $uid = (int) $user->ID; |
2244 | if ( ! $uid ) { |
2245 | /** This filter is documented in wp-includes/pluggable.php */ |
2246 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
2247 | } |
2248 |
|
2249 | $token = wp_get_session_token(); |
2250 | $i = wp_nonce_tick(); |
2251 |
|
2252 | return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); |
2253 | } |
2254 | endif; |
2255 |
|