add_menu( array( 'id' => 'debug-mode', 'title' => 'Debug Mode', ) ); $wp_admin_bar->add_menu( array( 'parent' => 'debug-mode', 'id' => 'debug-mode-wp', // labeling is ambiguous and should be clarified. describes current status in both title and link // thus the action in the link has to be inverted ( see init(), if it says 'on' we turn it off...) 'title' => __( 'WP_DEBUG: ' . ( WP_DEBUG ? 'on' : 'off' ) ), 'href' => add_query_arg( 'toggle-wp-debug', ( WP_DEBUG ? 'on' : 'off' ) ), ) ); $wp_admin_bar->add_menu( array( 'parent' => 'debug-mode', 'id' => 'debug-mode-script', 'title' => __( 'SCRIPT_DEBUG: ' . ( SCRIPT_DEBUG ? 'on' : 'off' ) ), 'href' => add_query_arg( 'toggle-script-debug', ( SCRIPT_DEBUG ? 'on' : 'off' ) ), ) ); } } //eof