PluginProbe
My WP Customize Admin/Frontend / trunk
My WP Customize Admin/Frontend vtrunk
1.27.4 1.27.3 trunk 1.0 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.10 1.10.1 1.10.2 1.11 1.12 1.12.1 1.12.2 1.13 1.13.1 1.13.2 1.14 1.15.0 1.16 1.17.0 All 76 releases
my-wp / developer / modules / mywp.developer.module.core.theme.php

mywp.developer.module.core.theme.php in My WP Customize Admin/Frontend trunk, at developer/modules/mywp.developer.module.core.theme.php

102 lines 2.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 if( ! class_exists( 'MywpDeveloperAbstractModule' ) ) {
8 return false;
9 }
10
11 if ( ! class_exists( 'MywpDeveloperModuleCoreTheme' ) ) :
12
13 final class MywpDeveloperModuleCoreTheme extends MywpDeveloperAbstractModule {
14
15 static protected $id = 'core_theme';
16
17 static protected $priority = 60;
18
19 public static function mywp_debug_renders( $debug_renders ) {
20
21 $debug_renders[ self::$id ] = array(
22 'debug_type' => 'core',
23 'title' => __( 'Current Theme' , 'my-wp' ),
24 );
25
26 return $debug_renders;
27
28 }
29
30 protected static function get_debug_lists() {
31
32 if( ! did_action( 'after_setup_theme' ) ) {
33
34 $called_text = sprintf( '%s::%s()' , __CLASS__ , __FUNCTION__ );
35
36 MywpHelper::error_after_called_message( 'after_setup_theme' , $called_text );
37
38 return false;
39
40 }
41
42 $debug_lists = array(
43 'get_template()' => get_template(),
44 'get_template_directory()' => get_template_directory(),
45 'get_template_directory_uri()' => get_template_directory_uri(),
46 'is_child_theme()' => is_child_theme(),
47 'get_stylesheet()' => get_stylesheet(),
48 'get_stylesheet_directory()' => get_stylesheet_directory(),
49 'get_stylesheet_directory_uri()' => get_stylesheet_directory_uri(),
50 'WP_DEFAULT_THEME' => WP_DEFAULT_THEME,
51 );
52
53 return $debug_lists;
54
55 }
56
57 protected static function mywp_debug_render() {
58
59 $debug_lists = self::get_debug_lists();
60
61 if( empty( $debug_lists ) ) {
62
63 return false;
64
65 }
66
67 echo '<table class="debug-table">';
68
69 foreach( $debug_lists as $key => $val ) {
70
71 echo '<tr>';
72
73 printf( '<th>%s</th>' , esc_html( $key ) );
74
75 echo '<td>';
76
77 if( in_array( $key , array( 'get_template_directory_uri()' , 'get_stylesheet_uri()' ) ) ) {
78
79 echo esc_url( $val );
80
81 } else {
82
83 echo esc_html( $val );
84
85 }
86
87 echo '</td>';
88
89 echo '</tr>';
90
91 }
92
93 echo '</table>';
94
95 }
96
97 }
98
99 MywpDeveloperModuleCoreTheme::init();
100
101 endif;
102