Changeset 2355200
- Timestamp:
- 08/08/2020 12:47:44 PM (5 years ago)
- Location:
- debug-bar-timber
- Files:
-
- 2 edited
- 1 copied
-
tags/1.0.2 (copied) (copied from debug-bar-timber/trunk)
-
tags/1.0.2/debug-bar-timber.php (modified) (1 diff)
-
trunk/debug-bar-timber.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
debug-bar-timber/tags/1.0.2/debug-bar-timber.php
r2355134 r2355200 5 5 Description: Adds Timber render to the debug bar. Requires the debug bar plugin. 6 6 Author: Jared Nova + Upstatement 7 Version: 0.3.1 7 Version: 1.0.2 8 8 Author URI: https://upstatement.com/ 9 */9 */ 10 10 11 add_filter('debug_bar_panels', static function($panels){12 require_once('class-debug-bar-timber.php');13 $panels[] = new Debug_Bar_Timber();14 return $panels;15 });11 add_filter('debug_bar_panels', static function($panels) { 12 require_once('class-debug-bar-timber.php'); 13 $panels[] = new Debug_Bar_Timber(); 14 return $panels; 15 }); 16 16 17 add_action('init', static function(){18 if ( !class_exists('Debug_Bar') ) {19 $class = 'error';17 add_action('init', static function() { 18 if ( !class_exists('Debug_Bar') ) { 19 $class = 'error'; 20 20 21 $url = admin_url('plugin-install.php?tab=plugin-information&plugin=debug-bar&TB_iframe=true&width=772&height=300');21 $url = admin_url('plugin-install.php?tab=plugin-information&plugin=debug-bar&TB_iframe=true&width=772&height=300'); 22 22 23 $text = "In order to use the Timber Debug Bar, you need to install and activate the <a href='$url' class='thickbox'>WordPress Debug Bar</a> Plugin";23 $text = "In order to use the Timber Debug Bar, you need to install and activate the <a href='$url' class='thickbox'>WordPress Debug Bar</a> Plugin"; 24 24 25 add_action( 'admin_notices', static function() use ( $text, $class ) {26 echo '<div class="'.$class.'"><p>'.$text.'</p></div>';27 }, 1 );28 }29 });25 add_action( 'admin_notices', static function() use ( $text, $class ) { 26 echo '<div class="'.$class.'"><p>'.$text.'</p></div>'; 27 }, 1 ); 28 } 29 }); 30 30 31 function tdb_enqueue_styles() {32 wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' );33 }34 add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 );31 function tdb_enqueue_styles() { 32 wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' ); 33 } 34 add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 ); -
debug-bar-timber/trunk/debug-bar-timber.php
r2355134 r2355200 5 5 Description: Adds Timber render to the debug bar. Requires the debug bar plugin. 6 6 Author: Jared Nova + Upstatement 7 Version: 0.3.1 7 Version: 1.0.2 8 8 Author URI: https://upstatement.com/ 9 */9 */ 10 10 11 add_filter('debug_bar_panels', static function($panels){12 require_once('class-debug-bar-timber.php');13 $panels[] = new Debug_Bar_Timber();14 return $panels;15 });11 add_filter('debug_bar_panels', static function($panels) { 12 require_once('class-debug-bar-timber.php'); 13 $panels[] = new Debug_Bar_Timber(); 14 return $panels; 15 }); 16 16 17 add_action('init', static function(){18 if ( !class_exists('Debug_Bar') ) {19 $class = 'error';17 add_action('init', static function() { 18 if ( !class_exists('Debug_Bar') ) { 19 $class = 'error'; 20 20 21 $url = admin_url('plugin-install.php?tab=plugin-information&plugin=debug-bar&TB_iframe=true&width=772&height=300');21 $url = admin_url('plugin-install.php?tab=plugin-information&plugin=debug-bar&TB_iframe=true&width=772&height=300'); 22 22 23 $text = "In order to use the Timber Debug Bar, you need to install and activate the <a href='$url' class='thickbox'>WordPress Debug Bar</a> Plugin";23 $text = "In order to use the Timber Debug Bar, you need to install and activate the <a href='$url' class='thickbox'>WordPress Debug Bar</a> Plugin"; 24 24 25 add_action( 'admin_notices', static function() use ( $text, $class ) {26 echo '<div class="'.$class.'"><p>'.$text.'</p></div>';27 }, 1 );28 }29 });25 add_action( 'admin_notices', static function() use ( $text, $class ) { 26 echo '<div class="'.$class.'"><p>'.$text.'</p></div>'; 27 }, 1 ); 28 } 29 }); 30 30 31 function tdb_enqueue_styles() {32 wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' );33 }34 add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 );31 function tdb_enqueue_styles() { 32 wp_enqueue_style( 'dbt', plugins_url( "timber-debug-bar.css", __FILE__ ), [], '20200710' ); 33 } 34 add_action( 'wp_enqueue_scripts', 'tdb_enqueue_styles', 99 );
Note: See TracChangeset
for help on using the changeset viewer.