Created
January 20, 2014 19:54
-
-
Save neojp/8527802 to your computer and use it in GitHub Desktop.
WordPress - Debug Bar Panel class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class CustomDebugBarPanel extends Debug_Bar_Panel { | |
public function init() { | |
$this->title(__('Custom Debug Bar Panel', 'debug-bar')); | |
add_action('wp_print_styles', array( $this, 'print_styles')); | |
add_action('admin_print_styles', array( $this, 'print_styles')); | |
} | |
public function prerender() { | |
$this->set_visible(true); | |
} | |
public function print_styles() { | |
wp_enqueue_style('custom-debug-bar-panel', plugins_url('css/custom-debug-bar-panel.css', __FILE__)); | |
} | |
public function render() { | |
?> | |
<div class="debug-bar-cron"> | |
<p>Content goes here</p> | |
</div> | |
<?php | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Plugin name: Custom Debug Bar Panel */ | |
add_filter('debug_bar_panels', function($panels) { | |
include_once('custom-debug-bar-panel-class.php'); | |
$panels[] = new CustomDebugBarPanel(); | |
return $panels; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment