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 |
|---|---|
| 1801 | if ( ! $uid ) { |
| 1802 | /** |
| 1803 | * Filters whether the user who generated the nonce is logged out. |
| 1804 | * |
| 1805 | * @since 3.5.0 |
| 1806 | * |
| 1807 | * @param int $uid ID of the nonce-owning user. |
| 1808 | * @param string $action The nonce action. |
| 1809 | */ |
| 1810 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
| 1811 | } |
| 1812 | |
| 1813 | if ( empty( $nonce ) ) { |
| 1814 | return false; |
| 1815 | } |
| 1816 | |
| 1817 | $token = wp_get_session_token(); |
| 1818 | $i = wp_nonce_tick(); |
| 1819 | |
| Line | Code |
| 1856 | * |
| 1857 | * @param string|int $action Scalar value to add context to the nonce. |
| 1858 | * @return string The token. |
| 1859 | */ |
| 1860 | function wp_create_nonce($action = -1) { |
| 1861 | $user = wp_get_current_user(); |
| 1862 | $uid = (int) $user->ID; |
| 1863 | if ( ! $uid ) { |
| 1864 | /** This filter is documented in wp-includes/pluggable.php */ |
| 1865 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
| 1866 | } |
| 1867 | |
| 1868 | $token = wp_get_session_token(); |
| 1869 | $i = wp_nonce_tick(); |
| 1870 | |
| 1871 | return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); |
| 1872 | } |
| 1873 | endif; |
| 1874 | |