Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class QueryDebugBarPanel
- extends Debug_Bar_Panel {
- function title( $title = null ) {
- return 'Query';
- }
- function render() {
- global $wp_query;
- $vars = [];
- foreach ( $wp_query->query_vars as $key => $value ) {
- if ( empty( $value ) ) {
- continue;
- }
- $vars[] = sprintf( '<tr><td>%s</td><td>%s</td></tr>', $key, print_r( $value, true ) );
- }
- $props = [];
- foreach ( get_object_vars( $wp_query ) as $key => $value ) {
- if ( empty( $value ) ) {
- continue;
- }
- $props[] = sprintf( '<tr><td>%s</td><td>%s</td></tr>', $key, print_r( $value, true ) );
- }
- $vars = implode( PHP_EOL, $vars );
- $props = implode( PHP_EOL, $props );
- include __DIR__ . '/template.php';
- }
- }
Add Comment
Please, Sign In to add comment