Display WP_DEBUG status in admin bar

0.0/5
<?php
add_action('admin_bar_menu', function($wp_admin_bar){
		$wp_admin_bar->add_node(array(
			'id' => 'wpd_debug',
			'parent' => 'top-secondary',
			'title' => 'WP_DEBUG is: '. (WP_DEBUG ? "ON":"OFF"),
			'meta' => array('class' => WP_DEBUG ? "wp_debug_on" : "wp_debug_off")
		));
});
add_action('admin_head', function(){ ?>
	<style>		
		.wp_debug_on > div {
			background-color:red
		}
	</style>
<?php });

Comments and reviews

{{ reviewsTotal }} Review
{{ reviewsTotal }} Reviews
{{ options.labels.newReviewButton }}
{{ userData.canReview.message }}

Description

This snippet displays whether WP_DEBUG is turned on or off in menu

Author

Tags