User Switching - Version 1.5.3

Version Description

Download this release

Release Info

Developer johnbillion
Plugin Icon 128x128 User Switching
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.3

Files changed (2) hide show
  1. readme.txt +2 -2
  2. user-switching.php +8 -6
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: johnbillion
4
  Tags: users, profiles, user switching, fast user switching, multisite, buddypress, bbpress, become, user management, developer
5
  Requires at least: 3.7
6
- Tested up to: 5.2
7
- Stable tag: 1.5.2
8
  Requires PHP: 5.3
9
  License: GPL v2 or later
10
 
3
  Contributors: johnbillion
4
  Tags: users, profiles, user switching, fast user switching, multisite, buddypress, bbpress, become, user management, developer
5
  Requires at least: 3.7
6
+ Tested up to: 5.3
7
+ Stable tag: 1.5.3
8
  Requires PHP: 5.3
9
  License: GPL v2 or later
10
 
user-switching.php CHANGED
@@ -10,7 +10,7 @@
10
  *
11
  * Plugin Name: User Switching
12
  * Description: Instant switching between user accounts in WordPress
13
- * Version: 1.5.2
14
  * Plugin URI: https://johnblackbourn.com/wordpress-plugin-user-switching/
15
  * Author: John Blackbourn & contributors
16
  * Author URI: https://github.com/johnbillion/user-switching/graphs/contributors
@@ -457,7 +457,7 @@ class user_switching {
457
  $old_user = self::get_old_user();
458
 
459
  if ( $old_user ) {
460
- $wp_admin_bar->add_menu( array(
461
  'parent' => $parent,
462
  'id' => 'switch-back',
463
  'title' => esc_html( sprintf(
@@ -480,7 +480,7 @@ class user_switching {
480
  ), $url );
481
  }
482
 
483
- $wp_admin_bar->add_menu( array(
484
  'parent' => $parent,
485
  'id' => 'switch-off',
486
  /* Translators: "switch off" means to temporarily log out */
@@ -491,7 +491,7 @@ class user_switching {
491
 
492
  if ( ! is_admin() && is_author() && ( get_queried_object() instanceof WP_User ) ) {
493
  if ( $old_user ) {
494
- $wp_admin_bar->add_menu( array(
495
  'parent' => 'edit',
496
  'id' => 'author-switch-back',
497
  'title' => esc_html( sprintf(
@@ -505,7 +505,7 @@ class user_switching {
505
  ), self::switch_back_url( $old_user ) ),
506
  ) );
507
  } elseif ( current_user_can( 'switch_to_user', get_queried_object_id() ) ) {
508
- $wp_admin_bar->add_menu( array(
509
  'parent' => 'edit',
510
  'id' => 'author-switch-to',
511
  'title' => esc_html__( 'Switch To', 'user-switching' ),
@@ -985,6 +985,8 @@ if ( ! function_exists( 'user_switching_set_olduser_cookie' ) ) {
985
  */
986
  do_action( 'set_user_switching_cookie', $auth_cookie, $expiration, $old_user_id, $scheme, $token );
987
 
 
 
988
  /**
989
  * Fires immediately before the User Switching old user cookie is set.
990
  *
@@ -997,7 +999,7 @@ if ( ! function_exists( 'user_switching_set_olduser_cookie' ) ) {
997
  * @param string $scheme Authentication scheme. Default 'logged_in'.
998
  * @param string $token User's session token to use for this cookie.
999
  */
1000
- do_action( 'set_olduser_cookie', $olduser_cookie, $expiration, $old_user_id, 'logged_in', $token );
1001
 
1002
  /** This filter is documented in wp-includes/pluggable.php */
1003
  if ( ! apply_filters( 'send_auth_cookies', true ) ) {
10
  *
11
  * Plugin Name: User Switching
12
  * Description: Instant switching between user accounts in WordPress
13
+ * Version: 1.5.3
14
  * Plugin URI: https://johnblackbourn.com/wordpress-plugin-user-switching/
15
  * Author: John Blackbourn & contributors
16
  * Author URI: https://github.com/johnbillion/user-switching/graphs/contributors
457
  $old_user = self::get_old_user();
458
 
459
  if ( $old_user ) {
460
+ $wp_admin_bar->add_node( array(
461
  'parent' => $parent,
462
  'id' => 'switch-back',
463
  'title' => esc_html( sprintf(
480
  ), $url );
481
  }
482
 
483
+ $wp_admin_bar->add_node( array(
484
  'parent' => $parent,
485
  'id' => 'switch-off',
486
  /* Translators: "switch off" means to temporarily log out */
491
 
492
  if ( ! is_admin() && is_author() && ( get_queried_object() instanceof WP_User ) ) {
493
  if ( $old_user ) {
494
+ $wp_admin_bar->add_node( array(
495
  'parent' => 'edit',
496
  'id' => 'author-switch-back',
497
  'title' => esc_html( sprintf(
505
  ), self::switch_back_url( $old_user ) ),
506
  ) );
507
  } elseif ( current_user_can( 'switch_to_user', get_queried_object_id() ) ) {
508
+ $wp_admin_bar->add_node( array(
509
  'parent' => 'edit',
510
  'id' => 'author-switch-to',
511
  'title' => esc_html__( 'Switch To', 'user-switching' ),
985
  */
986
  do_action( 'set_user_switching_cookie', $auth_cookie, $expiration, $old_user_id, $scheme, $token );
987
 
988
+ $scheme = 'logged_in';
989
+
990
  /**
991
  * Fires immediately before the User Switching old user cookie is set.
992
  *
999
  * @param string $scheme Authentication scheme. Default 'logged_in'.
1000
  * @param string $token User's session token to use for this cookie.
1001
  */
1002
+ do_action( 'set_olduser_cookie', $olduser_cookie, $expiration, $old_user_id, $scheme, $token );
1003
 
1004
  /** This filter is documented in wp-includes/pluggable.php */
1005
  if ( ! apply_filters( 'send_auth_cookies', true ) ) {