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 |
|---|---|
| 2263 | if ( ! $uid ) { |
| 2264 | /** |
| 2265 | * Filters whether the user who generated the nonce is logged out. |
| 2266 | * |
| 2267 | * @since 3.5.0 |
| 2268 | * |
| 2269 | * @param int $uid ID of the nonce-owning user. |
| 2270 | * @param string $action The nonce action. |
| 2271 | */ |
| 2272 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
| 2273 | } |
| 2274 | |
| 2275 | if ( empty( $nonce ) ) { |
| 2276 | return false; |
| 2277 | } |
| 2278 | |
| 2279 | $token = wp_get_session_token(); |
| 2280 | $i = wp_nonce_tick(); |
| 2281 | |
| Line | Code |
| 2318 | * |
| 2319 | * @param string|int $action Scalar value to add context to the nonce. |
| 2320 | * @return string The token. |
| 2321 | */ |
| 2322 | function wp_create_nonce( $action = -1 ) { |
| 2323 | $user = wp_get_current_user(); |
| 2324 | $uid = (int) $user->ID; |
| 2325 | if ( ! $uid ) { |
| 2326 | /** This filter is documented in wp-includes/pluggable.php */ |
| 2327 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
| 2328 | } |
| 2329 | |
| 2330 | $token = wp_get_session_token(); |
| 2331 | $i = wp_nonce_tick(); |
| 2332 | |
| 2333 | return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); |
| 2334 | } |
| 2335 | endif; |
| 2336 | |