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 http://opensource.org/licenses/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 | $css = ''; |
||
37 | if ( ! empty( Kirki::$sections ) ) { |
||
38 | foreach ( Kirki::$sections as $section_args ) { |
||
39 | if ( isset( $section_args['id'] ) && isset( $section_args['type'] ) && 'outer' === $section_args['type'] || 'kirki-outer' === $section_args['type'] ) { |
||
40 | $css .= '#customize-theme-controls li#accordion-section-' . $section_args['id'] . '{display:list-item!important;}'; |
||
41 | } |
||
42 | } |
||
43 | } |
||
44 | if ( ! empty( $css ) ) { |
||
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
45 | echo '<style>' . esc_attr( $css ) . '</style>'; |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 |