1 | <?php |
||
16 | class Kirki_Init { |
||
17 | |||
18 | /** |
||
19 | * The class constructor. |
||
20 | */ |
||
21 | public function __construct() { |
||
27 | |||
28 | /** |
||
29 | * Properly set the Kirki URL for assets. |
||
30 | * Determines if Kirki is installed as a plugin, in a child theme, or a parent theme |
||
31 | * and then does some calculations to get the proper URL for its CSS & JS assets. |
||
32 | */ |
||
33 | public function set_url() { |
||
64 | |||
65 | /** |
||
66 | * Helper function that adds the fields, sections and panels to the customizer. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | public function add_to_customizer() { |
||
78 | |||
79 | /** |
||
80 | * Register control types |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | public function register_control_types() { |
||
85 | global $wp_customize; |
||
86 | |||
87 | $section_types = apply_filters( 'kirki/section_types', array() ); |
||
88 | foreach ( $section_types as $section_type ) { |
||
89 | $wp_customize->register_section_type( $section_type ); |
||
90 | } |
||
91 | |||
92 | $wp_customize->register_control_type( 'Kirki_Control_Background' ); |
||
93 | $wp_customize->register_control_type( 'Kirki_Control_Code' ); |
||
94 | $wp_customize->register_control_type( 'Kirki_Control_Color' ); |
||
95 | $wp_customize->register_control_type( 'Kirki_Control_Color_Palette' ); |
||
96 | $wp_customize->register_control_type( 'Kirki_Control_Custom' ); |
||
97 | $wp_customize->register_control_type( 'Kirki_Control_Date' ); |
||
98 | $wp_customize->register_control_type( 'Kirki_Control_Dashicons' ); |
||
99 | $wp_customize->register_control_type( 'Kirki_Control_Dimension' ); |
||
100 | $wp_customize->register_control_type( 'Kirki_Control_Dimensions' ); |
||
101 | $wp_customize->register_control_type( 'Kirki_Control_Editor' ); |
||
102 | $wp_customize->register_control_type( 'Kirki_Control_Number' ); |
||
103 | $wp_customize->register_control_type( 'Kirki_Control_Radio' ); |
||
104 | $wp_customize->register_control_type( 'Kirki_Control_Radio_Buttonset' ); |
||
105 | $wp_customize->register_control_type( 'Kirki_Control_Radio_Image' ); |
||
106 | $wp_customize->register_control_type( 'Kirki_Control_Select' ); |
||
107 | $wp_customize->register_control_type( 'Kirki_Control_Slider' ); |
||
108 | $wp_customize->register_control_type( 'Kirki_Control_Switch' ); |
||
109 | $wp_customize->register_control_type( 'Kirki_Control_Generic' ); |
||
110 | $wp_customize->register_control_type( 'Kirki_Control_Toggle' ); |
||
111 | $wp_customize->register_control_type( 'Kirki_Control_Typography' ); |
||
112 | $wp_customize->register_control_type( 'Kirki_Control_Palette' ); |
||
113 | $wp_customize->register_control_type( 'Kirki_Control_Preset' ); |
||
114 | $wp_customize->register_control_type( 'Kirki_Control_Multicheck' ); |
||
115 | $wp_customize->register_control_type( 'Kirki_Control_Multicolor' ); |
||
116 | $wp_customize->register_control_type( 'Kirki_Control_Sortable' ); |
||
117 | } |
||
118 | |||
119 | /** |
||
120 | * Register our panels to the WordPress Customizer. |
||
121 | * |
||
122 | * @access public |
||
123 | */ |
||
124 | public function add_panels() { |
||
131 | |||
132 | /** |
||
133 | * Register our sections to the WordPress Customizer. |
||
134 | * |
||
135 | * @var object The WordPress Customizer object |
||
136 | * @return void |
||
137 | */ |
||
138 | public function add_sections() { |
||
145 | |||
146 | /** |
||
147 | * Create the settings and controls from the $fields array and register them. |
||
148 | * |
||
149 | * @var object The WordPress Customizer object |
||
150 | * @return void |
||
151 | */ |
||
152 | public function add_fields() { |
||
171 | |||
172 | /** |
||
173 | * Build the variables. |
||
174 | * |
||
175 | * @return array ('variable-name' => value) |
||
176 | */ |
||
177 | public static function get_variables() { |
||
216 | |||
217 | /** |
||
218 | * Process fields added using the 'kirki/fields' and 'kirki/controls' filter. |
||
219 | * These filters are no longer used, this is simply for backwards-compatibility. |
||
220 | */ |
||
221 | public function fields_from_filters() { |
||
233 | |||
234 | /** |
||
235 | * Handle saving of settings with "user_meta" storage type. |
||
236 | * |
||
237 | * @param string $value The value being saved. |
||
238 | * @param object $wp_customize_setting $WP_Customize_Setting The WP_Customize_Setting instance when saving is happening. |
||
239 | */ |
||
240 | public function update_user_meta( $value, $wp_customize_setting ) { |
||
243 | } |
||
244 |