wp_verify_nonce [ WordPress Function ]
wp_verify_nonce ( $nonce, $action = -1 )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: wp_explain_nonce, wp_version_check, wp_create_nonce, wp_tiny_mce, wp_kses_version
Verify that correct nonce was used with time limit.
The user is given an amount of time to use the token, so therefore, since the UID and $action remain the same, the independent variable is the time.
Source
<?php
function wp_verify_nonce($nonce, $action = -1) {
$user = wp_get_current_user();
$uid = (int) $user->ID;
$i = wp_nonce_tick();
// Nonce generated 0-12 hours ago
if ( substr(wp_hash($i . $action . $uid, 'nonce'), -12, 10) == $nonce )
return 1;
// Nonce generated 12-24 hours ago
if ( substr(wp_hash(($i - 1) . $action . $uid, 'nonce'), -12, 10) == $nonce )
return 2;
// Invalid nonce
return false;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/wp verify nonce « WordPress Codex
Description. Verify that correct nonce was used with time limit. Usage. <?php wp_verify_nonce( $nonce, $action ); ?> Parameters. $nonce: (string) (required) ...
codex.wordpress.org - Function Reference/wp create nonce « WordPress Codex
_wpnonce=<?php echo $nonce ?>'> ... <?php $nonce=$_REQUEST['_wpnonce'] ; if (! wp_verify_nonce($nonce, 'my-nonce') ) die('Security check'); ?> ...
codex.wordpress.org - wordpress - What wp_verify_nonce() means? - Stack Overflow
The nonce is a 'number used once' - a code that WP uses to make sure that POST data is coming from a safe place. This is useful to make sure that ...
stackoverflow.com - Improving security in Wordpress plugins using Nonces | Prelovac.com
You can use wp_verify_nonce() function to check the nonce before you ... if (! wp_verify_nonce($nonce, 'my-nonce') ) die("Security check"); ...
www.prelovac.com
Gebruikersdiscussies [ wordpress.org ]
- Phil Gyford on "How to verify the WP nonce after saving a Post"
- TWD on "WPtouch with WPML fatal error and partial fix"
- rajeshaah on "Fatal error: Call to undefined function wp_verify_nonce()"
- anver on "Fatal error: Call to undefined function wp_verify_nonce()"
- emixiak on "Fatal error: Call to undefined function wp_verify_nonce()"
- MuhammadWaqas on "Sight theme sight_meta_box_nonce errors"
- MuhammadWaqas on "Sight theme sight_meta_box_nonce errors"
- LoveAndMoreLove on "Sight theme sight_meta_box_nonce errors"
- LoveAndMoreLove on "Sight theme sight_meta_box_nonce errors"
- LoveAndMoreLove on "Sight theme sight_meta_box_nonce errors"