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