@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $fonts_to_load = $this->googlefonts->fonts; |
88 | 88 | |
89 | 89 | if ( ! empty( $fonts_to_load ) && 'preconnect' === $relation_type ) { |
90 | - $urls[] = array( |
|
90 | + $urls[ ] = array( |
|
91 | 91 | 'href' => 'https://fonts.gstatic.com', |
92 | 92 | 'crossorigin', |
93 | 93 | ); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $weights[ $key ] = str_replace( array( 'regular', 'bold', 'italic' ), array( '400', '', 'i' ), $value ); |
121 | 121 | } |
122 | 122 | } |
123 | - $this->fonts_to_load[] = $font . ':' . join( ',', $weights ) . ':cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai'; |
|
123 | + $this->fonts_to_load[ ] = $font . ':' . join( ',', $weights ) . ':cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai'; |
|
124 | 124 | } |
125 | 125 | if ( ! empty( $this->fonts_to_load ) ) { |
126 | 126 | Kirki_Modules_Webfont_Loader::$load = true; |
@@ -39,18 +39,18 @@ |
||
39 | 39 | |
40 | 40 | foreach ( array_keys( $value ) as $key ) { |
41 | 41 | |
42 | - $property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key; |
|
43 | - if ( isset( $output['choice'] ) && $output['property'] ) { |
|
44 | - if ( $key === $output['choice'] ) { |
|
45 | - $property = $output['property']; |
|
42 | + $property = ( empty( $output[ 'property' ] ) ) ? $key : $output[ 'property' ] . '-' . $key; |
|
43 | + if ( isset( $output[ 'choice' ] ) && $output[ 'property' ] ) { |
|
44 | + if ( $key === $output[ 'choice' ] ) { |
|
45 | + $property = $output[ 'property' ]; |
|
46 | 46 | } else { |
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | } |
50 | - if ( false !== strpos( $output['property'], '%%' ) ) { |
|
51 | - $property = str_replace( '%%', $key, $output['property'] ); |
|
50 | + if ( false !== strpos( $output[ 'property' ], '%%' ) ) { |
|
51 | + $property = str_replace( '%%', $key, $output[ 'property' ] ); |
|
52 | 52 | } |
53 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix']; |
|
53 | + $this->styles[ $output[ 'media_query' ] ][ $output[ 'element' ] ][ $property ] = $output[ 'prefix' ] . $this->process_property_value( $property, $value[ $key ] ) . $output[ 'suffix' ]; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | // Apply the kirki_config filter. |
64 | 64 | $config = apply_filters( 'kirki_config', array() ); |
65 | - if ( isset( $config['url_path'] ) ) { |
|
66 | - Kirki::$url = $config['url_path']; |
|
65 | + if ( isset( $config[ 'url_path' ] ) ) { |
|
66 | + Kirki::$url = $config[ 'url_path' ]; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | // Make sure the right protocol is used. |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | $this->control_types = $this->default_control_types(); |
145 | 145 | if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) { |
146 | - unset( $this->control_types['code_editor'] ); |
|
146 | + unset( $this->control_types[ 'code_editor' ] ); |
|
147 | 147 | } |
148 | 148 | foreach ( $this->control_types as $key => $classname ) { |
149 | 149 | if ( ! class_exists( $classname ) ) { |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | if ( ! empty( Kirki::$panels ) ) { |
175 | 175 | foreach ( Kirki::$panels as $panel_args ) { |
176 | 176 | // Extra checks for nested panels. |
177 | - if ( isset( $panel_args['panel'] ) ) { |
|
178 | - if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) { |
|
177 | + if ( isset( $panel_args[ 'panel' ] ) ) { |
|
178 | + if ( isset( Kirki::$panels[ $panel_args[ 'panel' ] ] ) ) { |
|
179 | 179 | // Set the type to nested. |
180 | - $panel_args['type'] = 'kirki-nested'; |
|
180 | + $panel_args[ 'type' ] = 'kirki-nested'; |
|
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | if ( ! empty( Kirki::$sections ) ) { |
196 | 196 | foreach ( Kirki::$sections as $section_args ) { |
197 | 197 | // Extra checks for nested sections. |
198 | - if ( isset( $section_args['section'] ) ) { |
|
199 | - if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) { |
|
198 | + if ( isset( $section_args[ 'section' ] ) ) { |
|
199 | + if ( isset( Kirki::$sections[ $section_args[ 'section' ] ] ) ) { |
|
200 | 200 | // Set the type to nested. |
201 | - $section_args['type'] = 'kirki-nested'; |
|
201 | + $section_args[ 'type' ] = 'kirki-nested'; |
|
202 | 202 | // We need to check if the parent section is nested inside a panel. |
203 | - $parent_section = Kirki::$sections[ $section_args['section'] ]; |
|
204 | - if ( isset( $parent_section['panel'] ) ) { |
|
205 | - $section_args['panel'] = $parent_section['panel']; |
|
203 | + $parent_section = Kirki::$sections[ $section_args[ 'section' ] ]; |
|
204 | + if ( isset( $parent_section[ 'panel' ] ) ) { |
|
205 | + $section_args[ 'panel' ] = $parent_section[ 'panel' ]; |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | // We're using a flat select. |
40 | 40 | foreach ( $this->choices as $key => $args ) { |
41 | - $this->choices[ $key ] = $args['label']; |
|
41 | + $this->choices[ $key ] = $args[ 'label' ]; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | } |
@@ -158,41 +158,41 @@ |
||
158 | 158 | // Get the basics from the parent class. |
159 | 159 | parent::to_json(); |
160 | 160 | // Default. |
161 | - $this->json['default'] = $this->setting->default; |
|
161 | + $this->json[ 'default' ] = $this->setting->default; |
|
162 | 162 | if ( isset( $this->default ) ) { |
163 | - $this->json['default'] = $this->default; |
|
163 | + $this->json[ 'default' ] = $this->default; |
|
164 | 164 | } |
165 | 165 | // Required. |
166 | - $this->json['required'] = $this->required; |
|
166 | + $this->json[ 'required' ] = $this->required; |
|
167 | 167 | // Output. |
168 | - $this->json['output'] = $this->output; |
|
168 | + $this->json[ 'output' ] = $this->output; |
|
169 | 169 | // Value. |
170 | - $this->json['value'] = $this->value(); |
|
170 | + $this->json[ 'value' ] = $this->value(); |
|
171 | 171 | // Choices. |
172 | - $this->json['choices'] = $this->choices; |
|
172 | + $this->json[ 'choices' ] = $this->choices; |
|
173 | 173 | // The link. |
174 | - $this->json['link'] = $this->get_link(); |
|
174 | + $this->json[ 'link' ] = $this->get_link(); |
|
175 | 175 | // The ID. |
176 | - $this->json['id'] = $this->id; |
|
176 | + $this->json[ 'id' ] = $this->id; |
|
177 | 177 | // Translation strings. |
178 | - $this->json['l10n'] = $this->l10n(); |
|
178 | + $this->json[ 'l10n' ] = $this->l10n(); |
|
179 | 179 | // The ajaxurl in case we need it. |
180 | - $this->json['ajaxurl'] = admin_url( 'admin-ajax.php' ); |
|
180 | + $this->json[ 'ajaxurl' ] = admin_url( 'admin-ajax.php' ); |
|
181 | 181 | // Input attributes. |
182 | - $this->json['inputAttrs'] = ''; |
|
182 | + $this->json[ 'inputAttrs' ] = ''; |
|
183 | 183 | foreach ( $this->input_attrs as $attr => $value ) { |
184 | - $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
184 | + $this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" '; |
|
185 | 185 | } |
186 | 186 | // The kirki-config. |
187 | - $this->json['kirkiConfig'] = $this->kirki_config; |
|
187 | + $this->json[ 'kirkiConfig' ] = $this->kirki_config; |
|
188 | 188 | // The option-type. |
189 | - $this->json['kirkiOptionType'] = $this->option_type; |
|
189 | + $this->json[ 'kirkiOptionType' ] = $this->option_type; |
|
190 | 190 | // The option-name. |
191 | - $this->json['kirkiOptionName'] = $this->option_name; |
|
191 | + $this->json[ 'kirkiOptionName' ] = $this->option_name; |
|
192 | 192 | // The preset. |
193 | - $this->json['preset'] = $this->preset; |
|
193 | + $this->json[ 'preset' ] = $this->preset; |
|
194 | 194 | // The CSS-Variables. |
195 | - $this->json['css-var'] = $this->css_var; |
|
195 | + $this->json[ 'css-var' ] = $this->css_var; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -76,17 +76,17 @@ discard block |
||
76 | 76 | echo '<style id="kirki-css-vars">'; |
77 | 77 | echo ':root{'; |
78 | 78 | foreach ( $fields as $id => $args ) { |
79 | - if ( ! isset( $args['css_var'] ) || empty( $args['css_var'] ) ) { |
|
79 | + if ( ! isset( $args[ 'css_var' ] ) || empty( $args[ 'css_var' ] ) ) { |
|
80 | 80 | continue; |
81 | 81 | } |
82 | - if ( is_string( $args['css_var'] ) ) { |
|
83 | - $args['css_var'] = array( $args['css_var'], '$' ); |
|
82 | + if ( is_string( $args[ 'css_var' ] ) ) { |
|
83 | + $args[ 'css_var' ] = array( $args[ 'css_var' ], '$' ); |
|
84 | 84 | } |
85 | - $val = Kirki_Values::get_value( $args['kirki_config'], $id ); |
|
86 | - if ( isset( $args['css_var'][2] ) && is_array( $val ) && isset( $val[ $args['css_var'][2] ] ) ) { |
|
87 | - $val = $val[ $args['css_var'][2] ]; |
|
85 | + $val = Kirki_Values::get_value( $args[ 'kirki_config' ], $id ); |
|
86 | + if ( isset( $args[ 'css_var' ][ 2 ] ) && is_array( $val ) && isset( $val[ $args[ 'css_var' ][ 2 ] ] ) ) { |
|
87 | + $val = $val[ $args[ 'css_var' ][ 2 ] ]; |
|
88 | 88 | } |
89 | - echo esc_attr( $args['css_var'][0] ) . ':' . esc_attr( str_replace( '$', $val, $args['css_var'][1] ) ) . ';'; |
|
89 | + echo esc_attr( $args[ 'css_var' ][ 0 ] ) . ':' . esc_attr( str_replace( '$', $val, $args[ 'css_var' ][ 1 ] ) ) . ';'; |
|
90 | 90 | } |
91 | 91 | echo '}'; |
92 | 92 | echo '</style>'; |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $fields = Kirki::$fields; |
107 | 107 | $data = array(); |
108 | 108 | foreach ( $fields as $field ) { |
109 | - if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_var'] ) && ! empty( $field['css_var'] ) ) { |
|
110 | - $data[] = $field; |
|
109 | + if ( isset( $field[ 'transport' ] ) && 'postMessage' === $field[ 'transport' ] && isset( $field[ 'css_var' ] ) && ! empty( $field[ 'css_var' ] ) ) { |
|
110 | + $data[ ] = $field; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data ); |