Make WordPress Core

Changeset 21837


Ignore:
Timestamp:
09/13/2012 05:17:47 PM (9 years ago)
Author:
nacin
Message:

Add nonce_user_logged_out filters to wp_create_nonce() and wp_verify_nonce() for when there is no user ID. Provides plugins the ability to tie a nonce to some other characteristic of the session. props sc0ttkclark, fixes #21111.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r21685 r21837  
    12521252    $user = wp_get_current_user();
    12531253    $uid = (int) $user->ID;
     1254    if ( ! $uid )
     1255        $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
    12541256
    12551257    $i = wp_nonce_tick();
     
    12781280    $user = wp_get_current_user();
    12791281    $uid = (int) $user->ID;
     1282    if ( ! $uid )
     1283        $uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
    12801284
    12811285    $i = wp_nonce_tick();
Note: See TracChangeset for help on using the changeset viewer.