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.


git-svn-id: https://develop.svn.wordpress.org/trunk@29635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-08-27 02:06:53 +00:00
parent 322991024f
commit e3345398aa
4 changed files with 78 additions and 59 deletions

View File

@@ -2207,7 +2207,7 @@ function wp_get_session_token() {
*/
function wp_get_all_sessions() {
$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
return $manager->get_all_sessions();
return $manager->get_all();
}
/**
@@ -2219,7 +2219,7 @@ function wp_destroy_current_session() {
$token = wp_get_session_token();
if ( $token ) {
$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
$manager->destroy_token( $token );
$manager->destroy( $token );
}
}
@@ -2232,7 +2232,7 @@ function wp_destroy_other_sessions() {
$token = wp_get_session_token();
if ( $token ) {
$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
$manager->destroy_other_tokens( $token );
$manager->destroy_others( $token );
}
}
@@ -2243,5 +2243,5 @@ function wp_destroy_other_sessions() {
*/
function wp_destroy_all_sessions() {
$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
$manager->destroy_all_tokens();
$manager->destroy_all();
}