Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
User Switching: avoid notice when placed in mu-plugins
Index: trunk/user-switching.php
===================================================================
--- trunk/user-switching.php (revision 416611)
+++ trunk/user-switching.php (working copy)
@@ -19,12 +19,10 @@
*/
-if ( !defined( 'OLDUSER_COOKIE' ) )
- define( 'OLDUSER_COOKIE', 'wordpress_olduser_' . COOKIEHASH );
-
class user_switching {
function user_switching() {
+ add_action( 'plugins_loaded', array( $this, 'set_old_cookie' ) );
add_action( 'admin_init', array( $this, 'admin_init' ) );
add_action( 'admin_notices', array( $this, 'admin_notice' ) );
add_action( 'user_row_actions', array( $this, 'user_row' ), 10, 2 );
@@ -34,6 +32,11 @@
add_action( 'wp_login', 'wp_clear_olduser_cookie' );
}
+ function set_old_cookie() {
+ if ( !defined( 'OLDUSER_COOKIE' ) )
+ define( 'OLDUSER_COOKIE', 'wordpress_olduser_' . COOKIEHASH );
+ }
+
function personal_options( $user ) {
$current_user = wp_get_current_user();
if ( !current_user_can( 'edit_user', $user->ID ) or ( $user->ID == $current_user->ID ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.