Support » Plugin: User Switching » Notices

  • Resolved Pietro Gregorini

    (@pietrogregorini)


    When I switch to a user, I get several notices with Debug active all over the page (at the top and in the menu on the left):

    Notice: Undefined offset: 2 in /web/htdocs/home/wp-admin/includes/plugin.php on line 1419 Notice: Undefined offset: 2 in /web/htdocs/home/wp-admin/includes/plugin.php on line 1419
    Skip to main content Notice: Undefined offset: 2 in /web/htdocs/home/wp-admin/includes/plugin.php on line 1419 Notice: Undefined offset: 2 in /web/htdocs/home/wp-admin/includes/plugin.php on line 1419

    http://wordpress.org/extend/plugins/user-switching/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Hi Pietro,

    Those notices don’t appear for me on any of the many sites that I use User Switching on.

    Can you disable all other plugins and switch to the default theme and see if the issue persists?

    John

    Ok, I just tried right now disabling all other plugins except User Switching and I got the same notices.

    Then I got a suspect, even if the notice was related to “plugin.php” file and not to my theme files: I tried disabling the dashboard hacks in my functions.php and I didn’t got any more notices.

    The code which gave me problems was this, used to change menu labels:

    // Change "Posts" menu with new labels
    function change_post_menu_label() {
    	global $menu;
    	global $submenu;
    	$menu[5][0] = 'Articles';
    	$submenu['edit.php'][5][0] = 'All Articles';
    	$submenu['edit.php'][10][0] = 'Add New';
    	$submenu['edit.php'][15][0] = 'Topics'; // Change name for Categories
    	$submenu['edit.php'][16][0] = 'Tags'; // Change name for Tags
    	echo '';
    }
    add_action('admin_menu', 'change_post_menu_label');

    Could you give me some instruction to solve this issue?

    Ok, I resolved deleting the parts not supported by non-administrators users, so the code became simply:

    // Change "Posts" menu with new labels
    function change_post_menu_label() {
    	global $menu;
    	global $submenu;
    	$menu[5][0] = 'Articles';
    	$submenu['edit.php'][5][0] = 'All Articles';
    	$submenu['edit.php'][10][0] = 'Add New';
    	echo '';
    }
    add_action('admin_menu', 'change_post_menu_label');
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Notices’ is closed to new replies.