File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -156,4 +156,37 @@ function limitText(field, maxChar){
156
156
<?php
157
157
}
158
158
}
159
- add_action ( 'wp_footer ' , 'wpufe_javascript ' ,20 );
159
+ add_action ( 'wp_footer ' , 'wpufe_javascript ' ,20 );
160
+
161
+ // ==(begin)== backtrace function =========
162
+
163
+ function uthsc_call_stack ($ stacktrace = array ()) {
164
+
165
+ !$ stacktrace && ($ stacktrace = debug_backtrace ()) && array_shift ($ stacktrace );
166
+
167
+ print "<table class='stack small-text-center'> " ;
168
+ print "<tr> " ;
169
+ print "<th colspan='4' style='background: brown; color: #fff;'>Backtrace</th> " ;
170
+ print "</tr> " ;
171
+ print "<tr> " ;
172
+ print "<th style='background: #555; color: #fff;'>Order</th> " ;
173
+ print "<th style='background: #666; color: #fff;font-weight: 200;'>/path/<strong>filename.php</strong></th> " ;
174
+ print "<th style='background: #555; color: #fff;width: 20%;'>Function</th> " ;
175
+ print "<th style='background: #666; color: #fff;width: 5%;'>Line</th> " ;
176
+ print "</tr> " ;
177
+
178
+ $ i = 1 ;
179
+ foreach ($ stacktrace as $ node ) {
180
+ print "<tr>
181
+ <td style='text-align: center;'> $ i. </td>
182
+ <td style='text-align: right;'> " .dirname ($ node ['file ' ])."/<strong> " .basename ($ node ['file ' ]) ."</strong></td>
183
+ <td style='text-align: center;'> " .$ node ['function ' ] . "</td>
184
+ <td style='text-align: center;'> " .$ node ['line ' ]. "</td></tr> " ;
185
+ $ i ++;
186
+ }
187
+ print "</table> " ;
188
+
189
+ }
190
+ // use uthsc_call_stack(); in header.php to execute
191
+
192
+ // ===(end)=== backtrace function =========
You can’t perform that action at this time.
0 commit comments