Issues (377)

core/class-kirki-sections.php (1 issue)

1
<?php
2
/**
3
 * Additional tweaks for sections.
4
 *
5
 * @package     Kirki
6
 * @category    Core
7
 * @author      Aristeides Stathopoulos
8
 * @copyright   Copyright (c) 2017, Aristeides Stathopoulos
9
 * @license    https://opensource.org/licenses/MIT
10
 * @since       3.0.17
11
 */
12
13
/**
14
 * Additional tweaks for sections.
15
 */
16
class Kirki_Sections {
17
18
	/**
19
	 * The object constructor.
20
	 *
21
	 * @access public
22
	 * @since 3.0.17
23
	 */
24
	public function __construct() {
25
		add_action( 'customize_controls_print_footer_scripts', array( $this, 'outer_sections_css' ) );
26
	}
27
28
	/**
29
	 * Generate CSS for the outer sections.
30
	 * These are by default hidden, we need to expose them.
31
	 *
32
	 * @since 3.0.17
33
	 * @return void
34
	 */
35
	public function outer_sections_css() {
36
		echo '<style>';
37
		$css = '';
0 ignored issues
show
The assignment to $css is dead and can be removed.
Loading history...
38
		if ( ! empty( Kirki::$sections ) ) {
39
			foreach ( Kirki::$sections as $section_args ) {
40
				if ( isset( $section_args['id'] ) && isset( $section_args['type'] ) && 'outer' === $section_args['type'] || 'kirki-outer' === $section_args['type'] ) {
41
					echo '#customize-theme-controls li#accordion-section-' . esc_html( $section_args['id'] ) . '{display:list-item!important;}';
42
				}
43
			}
44
		}
45
		echo '</style>';
46
	}
47
}
48