Guest User

Untitled

a guest
Aug 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function wp_create_nonce($action = -1) {
  2. $user = wp_get_current_user();
  3. $uid = (int) $user->ID;
  4. if ( ! $uid ) {
  5. /** This filter is documented in wp-includes/pluggable.php */
  6. $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
  7. }
  8.  
  9. $token = wp_get_session_token();
  10. $i = wp_nonce_tick();
  11.  
  12. return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
  13. }
Add Comment
Please, Sign In to add comment