PluginProbe
My WP Customize Admin/Frontend / 1.8
My WP Customize Admin/Frontend v1.8
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.dev.actions.php

mywp.developer.module.dev.actions.php in My WP Customize Admin/Frontend 1.8, at developer/modules/mywp.developer.module.dev.actions.php

153 lines 2.6 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( 'MywpDeveloperModuleDevActions' ) ) :
12
13 final class MywpDeveloperModuleDevActions extends MywpDeveloperAbstractModule {
14
15 static protected $id = 'dev_actions';
16
17 static protected $priority = 1000;
18
19 public static function mywp_debug_renders( $debug_renders ) {
20
21 $debug_renders[ self::$id ] = array(
22 'debug_type' => 'dev',
23 'title' => __( 'Action Fooks' , 'my-wp' ),
24 );
25
26 return $debug_renders;
27
28 }
29
30 private static function is_mywp_function( $name ) {
31
32 if( strpos( $name , 'mywp' ) !== false ) {
33
34 return true;
35
36 }
37
38 if( strpos( $name , 'Mywp' ) !== false ) {
39
40 return true;
41
42 }
43
44 return false;
45
46 }
47
48 private static function get_wp_actions() {
49
50 global $wp_actions;
51
52 return $wp_actions;
53
54 }
55
56 protected static function mywp_developer_debug() {
57
58 $wp_actions = self::get_wp_actions();
59
60 echo '$wp_actions = ' . "\n";
61
62 foreach( $wp_actions as $wp_action => $count ) {
63
64 echo ' - ' . $wp_action . "\n";
65
66 $filter_to_func = MywpDeveloper::get_filter_to_func( $wp_action );
67
68 if( ! empty( $filter_to_func ) ) {
69
70 foreach( $filter_to_func as $func ) {
71
72 echo ' ';
73 printf( '(%d) %s' , $func['priority'] , $func['print_format'] );
74 echo "\n";
75
76 }
77
78 echo "\n";
79
80 }
81
82 }
83
84 }
85
86 protected static function mywp_debug_render() {
87
88 $wp_actions = self::get_wp_actions();
89
90 echo '<ul class="core-actions">';
91
92 foreach( $wp_actions as $wp_action => $count ) {
93
94 $add_class = '';
95
96 if( self::is_mywp_function( $wp_action ) ) {
97
98 $add_class = 'mywp-action ';
99
100 }
101
102 echo '<li class="core-action ' . esc_attr( $add_class ) . '">' . $wp_action;
103
104 $filter_to_func = MywpDeveloper::get_filter_to_func( $wp_action );
105
106 if( ! empty( $filter_to_func ) ) {
107
108 echo '<ul class="core-action-filters">';
109
110 foreach( $filter_to_func as $func ) {
111
112 echo '<li class="core-action-filter">';
113
114 printf( '<strong class="priority">(%d)</strong> %s' , $func['priority'] , $func['print_format'] );
115
116 echo '</li>';
117
118 }
119
120 echo '</ul>';
121
122 }
123
124 echo '</li>';
125
126 }
127
128 echo '</ul>';
129
130 }
131
132 public static function mywp_debug_render_footer() {
133
134 ?>
135 <style>
136 #mywp-debug .core-actions .core-action.mywp-action {
137 background: rgba(255, 150, 0, 0.1);
138 color: #AEAEAE;
139 }
140 #mywp-debug .core-actions .core-action .priority {
141 background: rgba(0, 0, 0, 0.2);
142 }
143 </style>
144 <?php
145
146 }
147
148 }
149
150 MywpDeveloperModuleDevActions::init();
151
152 endif;
153