-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions-debug.php
More file actions
53 lines (37 loc) · 1.14 KB
/
functions-debug.php
File metadata and controls
53 lines (37 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
add_filter( 'debug_bar_panels', 'wpskillz_debug_bar_panel' );
function wpskillz_debug_bar_panel( $panels ) {
class WPSkillz_Test_Panel extends Debug_Bar_Panel {
function init() {
$this->title( __('WPSkillz', 'debug-bar') );
}
function prerender() {
$this->set_visible( true );
}
function render() {
global $wp;
echo "<div id='debug-bar-wpskillz'>";
global $current_user;
echo '
<h3>Current User:</h3>
<ul>
<li><strong>ID</strong>: ' . $current_user->ID . '</li>
<li><strong>Name</strong>: ' . $current_user->display_name . '</li>
</ul>
<h3>Test Progress:</h3>
<ul>
<li>Completed ' . WPSkillz_Session::$complete . ' of ' . WPSkillz_Session::$oftotal . ' questions</li>
<li>Correct answers: ' . WPSkillz_Session::$correct . ' of ' . WPSkillz_Session::$complete .'</li>
</ul>
';
echo '<h3>$progress</h3>';
var_dump( WPSkillz_Session::$progress );
echo '<br><br>';
echo '<h3>Session variable contents</h3>';
var_dump( $_SESSION['wpskillz_test'] );
echo '</div>';
}
}
$panels[] = new WPSkillz_Test_Panel;
return $panels;
}