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