debug-bar.php 663 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * Checks if the search module is active, and if so, will initialize the singleton instance
  4. * of Jetpack_Search_Debug_Bar and add it to the array of debug bar panels.
  5. *
  6. * @param array $panels The array of debug bar panels.
  7. * @return array $panel The array of debug bar panels with our added panel.
  8. */
  9. function init_jetpack_search_debug_bar( $panels ) {
  10. if ( ! Jetpack::is_module_active( 'search' ) ) {
  11. return $panels;
  12. }
  13. require_once dirname( __FILE__ ) . '/debug-bar/class.jetpack-search-debug-bar.php';
  14. $panels[] = Jetpack_Search_Debug_Bar::instance();
  15. return $panels;
  16. }
  17. add_filter( 'debug_bar_panels', 'init_jetpack_search_debug_bar' );