WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/27/2014 02:06:53 AM (6 years ago)
Author:
nacin
Message:

Rename the public methods in the session tokens API.

Introduces a new get( $token ) method. get_token() would not have made sense and spurred the overall renaming. Public methods are now get, get_all, verify, create, update, destroy, destroy_others, and destroy_all.

The protected abstract methods designed for alternative implementations remain the same.

props mdawaffe.
see #20276.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r29454 r29635  
    22082208function wp_get_all_sessions() {
    22092209    $manager = WP_Session_Tokens::get_instance( get_current_user_id() );
    2210     return $manager->get_all_sessions();
     2210    return $manager->get_all();
    22112211}
    22122212
     
    22202220    if ( $token ) {
    22212221        $manager = WP_Session_Tokens::get_instance( get_current_user_id() );
    2222         $manager->destroy_token( $token );
     2222        $manager->destroy( $token );
    22232223    }
    22242224}
     
    22332233    if ( $token ) {
    22342234        $manager = WP_Session_Tokens::get_instance( get_current_user_id() );
    2235         $manager->destroy_other_tokens( $token );
     2235        $manager->destroy_others( $token );
    22362236    }
    22372237}
     
    22442244function wp_destroy_all_sessions() {
    22452245    $manager = WP_Session_Tokens::get_instance( get_current_user_id() );
    2246     $manager->destroy_all_tokens();
    2247 }
     2246    $manager->destroy_all();
     2247}
Note: See TracChangeset for help on using the changeset viewer.