class-debug-bar-request.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. class Debug_Bar_Request extends Debug_Bar_Panel {
  3. function init() {
  4. $this->title( __('Request', 'debug-bar') );
  5. }
  6. function prerender() {
  7. $this->set_visible( ! is_admin() );
  8. }
  9. function render() {
  10. global $wp;
  11. echo "<div id='debug-bar-request'>";
  12. if ( empty($wp->request) )
  13. $request = 'None';
  14. else
  15. $request = $wp->request;
  16. echo '<h3>Request:</h3>';
  17. echo '<p>' . esc_html( $request ) . '</p>';
  18. if ( empty($wp->query_string) )
  19. $query_string = 'None';
  20. else
  21. $query_string = $wp->query_string;
  22. echo '<h3>Query String:</h3>';
  23. echo '<p>' . esc_html( $query_string ) . '</p>';
  24. if ( empty($wp->matched_rule) )
  25. $matched_rule = 'None';
  26. else
  27. $matched_rule = $wp->matched_rule;
  28. echo '<h3>Matched Rewrite Rule:</h3>';
  29. echo '<p>' . esc_html( $matched_rule ) . '</p>';
  30. if ( empty($wp->matched_query) )
  31. $matched_query = 'None';
  32. else
  33. $matched_query = $wp->matched_query;
  34. echo '<h3>Matched Rewrite Query:</h3>';
  35. echo '<p>' . esc_html( $matched_query ) . '</p>';
  36. echo '</div>';
  37. }
  38. }