Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Label_Control
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 2
20
0.00% covered (danger)
0.00%
0 / 1
 render
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 render_content
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2/**
3 * A label-only Customizer control for use with Jetpack Search configuration
4 *
5 * @package automattic/jetpack
6 * @since 8.6.0
7 */
8
9namespace Automattic\Jetpack\Search;
10
11use WP_Customize_Control;
12
13if ( ! class_exists( 'WP_Customize_Control' ) ) {
14    return;
15}
16/**
17 * Label Control class.
18 */
19class Label_Control extends WP_Customize_Control {
20    /**
21     * Override rendering for custom class name; omit element ID.
22     */
23    protected function render() {
24        echo '<li class="customize-control customize-label-control">';
25        $this->render_content();
26        echo '</li>';
27    }
28
29    /**
30     * Override content rendering.
31     */
32    protected function render_content() {
33        if ( ! empty( $this->label ) ) : ?>
34            <label class="customize-control-title">
35                <?php echo esc_html( $this->label ); ?>
36            </label>
37        <?php endif; ?>
38        <?php if ( ! empty( $this->description ) ) : ?>
39            <span class="description customize-control-description">
40                <?php echo esc_html( $this->description ); ?>
41            </span>
42            <?php
43        endif;
44    }
45}