debug-bar.php
| 1 | <?php |
| 2 | /** |
| 3 | * 3rd Party integration for Debug Bar. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Checks if the search module is active, and if so, will initialize the singleton instance |
| 10 | * of Jetpack_Search_Debug_Bar and add it to the array of debug bar panels. |
| 11 | * |
| 12 | * @param array $panels The array of debug bar panels. |
| 13 | * @return array $panel The array of debug bar panels with our added panel. |
| 14 | */ |
| 15 | function init_jetpack_search_debug_bar( $panels ) { |
| 16 | if ( ! Jetpack::is_module_active( 'search' ) ) { |
| 17 | return $panels; |
| 18 | } |
| 19 | |
| 20 | require_once __DIR__ . '/debug-bar/class-jetpack-search-debug-bar.php'; |
| 21 | $panels[] = Jetpack_Search_Debug_Bar::instance(); |
| 22 | return $panels; |
| 23 | } |
| 24 | add_filter( 'debug_bar_panels', 'init_jetpack_search_debug_bar' ); |
| 25 |