Completed
Push — update/search/formatting-and-p... ( cb3630...02e684 )
by Alex
49:40 queued 38:52
created

debug-bar.php ➔ init_jetpack_search_debug_bar()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
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