Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
CRAP
n/a
0 / 0
init_jetpack_search_debug_bar
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2/**
3 * 3rd Party integration for Debug Bar.
4 *
5 * @package automattic/jetpack
6 */
7
8if ( ! 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 */
19function 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}
28add_filter( 'debug_bar_panels', 'init_jetpack_search_debug_bar' );