class-debug-bar-object-cache.php 501 B

123456789101112131415161718192021222324
  1. <?php
  2. class Debug_Bar_Object_Cache extends Debug_Bar_Panel {
  3. function init() {
  4. $this->title( __('Object Cache', 'debug-bar') );
  5. }
  6. function prerender() {
  7. global $wp_object_cache;
  8. $this->set_visible( is_object($wp_object_cache) && method_exists($wp_object_cache, 'stats') );
  9. }
  10. function render() {
  11. global $wp_object_cache;
  12. ob_start();
  13. echo "<div id='object-cache-stats'>";
  14. $wp_object_cache->stats();
  15. echo "</div>";
  16. $out = ob_get_contents();
  17. ob_end_clean();
  18. echo $out;
  19. }
  20. }