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 |
|---|---|
| 1782 | if ( ! $uid ) { |
| 1783 | /** |
| 1784 | * Filter whether the user who generated the nonce is logged out. |
| 1785 | * |
| 1786 | * @since 3.5.0 |
| 1787 | * |
| 1788 | * @param int $uid ID of the nonce-owning user. |
| 1789 | * @param string $action The nonce action. |
| 1790 | */ |
| 1791 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
| 1792 | } |
| 1793 | |
| 1794 | if ( empty( $nonce ) ) { |
| 1795 | return false; |
| 1796 | } |
| 1797 | |
| 1798 | $token = wp_get_session_token(); |
| 1799 | $i = wp_nonce_tick(); |
| 1800 | |
| Line | Code |
| 1823 | * |
| 1824 | * @param string|int $action Scalar value to add context to the nonce. |
| 1825 | * @return string The token. |
| 1826 | */ |
| 1827 | function wp_create_nonce($action = -1) { |
| 1828 | $user = wp_get_current_user(); |
| 1829 | $uid = (int) $user->ID; |
| 1830 | if ( ! $uid ) { |
| 1831 | /** This filter is documented in wp-includes/pluggable.php */ |
| 1832 | $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); |
| 1833 | } |
| 1834 | |
| 1835 | $token = wp_get_session_token(); |
| 1836 | $i = wp_nonce_tick(); |
| 1837 | |
| 1838 | return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); |
| 1839 | } |
| 1840 | endif; |
| 1841 | |