@@ -203,9 +203,9 @@ |
||
203 | 203 | // and run it through the callback function. |
204 | 204 | // If no callback is defined (false) then just get the value. |
205 | 205 | if ( $variable_callback ) { |
206 | - $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
206 | + $variables[$variable_name] = call_user_func( $field_variable['callback'], Kirki::get_option( $field['settings'] ) ); |
|
207 | 207 | } else { |
208 | - $variables[ $variable_name ] = Kirki::get_option( $field['settings'] ); |
|
208 | + $variables[$variable_name] = Kirki::get_option( $field['settings'] ); |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // Sanitize each sub-value separately. |
54 | 54 | foreach ( $value as $key => $sub_value ) { |
55 | - $value[ $key ] = Kirki_Sanitize_Values::css_dimension( $sub_value ); |
|
55 | + $value[$key] = Kirki_Sanitize_Values::css_dimension( $sub_value ); |
|
56 | 56 | } |
57 | 57 | return $value; |
58 | 58 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $this->choices['controls'] = array(); |
70 | 70 | if ( is_array( $this->default ) ) { |
71 | 71 | foreach ( $this->default as $key => $value ) { |
72 | - $this->choices['controls'][ $key ] = true; |
|
72 | + $this->choices['controls'][$key] = true; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | // Simple sanitization. |
37 | 37 | if ( ! empty( $this->button_labels ) ) { |
38 | 38 | foreach ( $this->button_labels as $key => $value ) { |
39 | - $this->button_labels[ sanitize_key( $key ) ] = esc_attr( $value ); |
|
39 | + $this->button_labels[sanitize_key( $key )] = esc_attr( $value ); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | foreach ( self::$modules as $key => $module_class ) { |
83 | 83 | if ( class_exists( $module_class ) ) { |
84 | - self::$active_modules[ $key ] = new $module_class(); |
|
84 | + self::$active_modules[$key] = new $module_class(); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $key = array_search( $module, self::$modules, true ); |
117 | 117 | if ( false !== $key ) { |
118 | - unset( self::$modules[ $key ] ); |
|
118 | + unset( self::$modules[$key] ); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $fields = Kirki::$fields; |
43 | 43 | foreach ( $fields as $field ) { |
44 | 44 | if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['js_vars'] ) && ! empty( $field['js_vars'] ) && is_array( $field['js_vars'] ) && isset( $field['settings'] ) ) { |
45 | - $js_vars_fields[ $field['settings'] ] = $field['js_vars']; |
|
45 | + $js_vars_fields[$field['settings']] = $field['js_vars']; |
|
46 | 46 | } |
47 | 47 | } |
48 | 48 | wp_localize_script( 'kirki_auto_postmessage', 'jsvars', $js_vars_fields ); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function add_icon( $id, $icon, $context = 'section' ) { |
51 | 51 | |
52 | - self::$icons[ $context ][ $id ] = trim( $icon ); |
|
52 | + self::$icons[$context][$id] = trim( $icon ); |
|
53 | 53 | |
54 | 54 | } |
55 | 55 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | foreach ( $fields as $field ) { |
55 | 55 | if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) { |
56 | 56 | $id = str_replace( '[', '-', str_replace( ']', '', $field['settings'] ) ); |
57 | - $this->tooltips_content[ $id ] = array( |
|
57 | + $this->tooltips_content[$id] = array( |
|
58 | 58 | 'id' => $id, |
59 | 59 | 'content' => wp_kses_post( $field['tooltip'] ), |
60 | 60 | ); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function add_tooltip( $field_id, $tooltip ) { |
74 | 74 | |
75 | - $this->tooltips_content[ $field_id ] = array( |
|
75 | + $this->tooltips_content[$field_id] = array( |
|
76 | 76 | 'id' => sanitize_key( $field_id ), |
77 | 77 | 'content' => wp_kses_post( $tooltip ), |
78 | 78 | ); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @access public |
40 | 40 | * @var null|string|array |
41 | 41 | */ |
42 | - public static $settings = null; |
|
42 | + public static $settings = null; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Output. |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @access public |
49 | 49 | * @var array |
50 | 50 | */ |
51 | - public static $output = array(); |
|
51 | + public static $output = array(); |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Callback. |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @access public |
58 | 58 | * @var null|string|array |
59 | 59 | */ |
60 | - public static $callback = null; |
|
60 | + public static $callback = null; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Option Name. |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @access public |
76 | 76 | * @var string |
77 | 77 | */ |
78 | - public static $field_type = null; |
|
78 | + public static $field_type = null; |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Google Fonts |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | 'kirki-multicolor' => 'Kirki_Output_Field_Multicolor', |
173 | 173 | ) ); |
174 | 174 | if ( array_key_exists( self::$field_type, $field_output_classes ) ) { |
175 | - $classname = $field_output_classes[ self::$field_type ]; |
|
175 | + $classname = $field_output_classes[self::$field_type]; |
|
176 | 176 | } |
177 | 177 | $obj = new $classname( $field['kirki_config'], self::$output, self::$value ); |
178 | 178 | return $obj->get_styles(); |
@@ -236,10 +236,10 @@ discard block |
||
236 | 236 | 'transition', |
237 | 237 | 'transition-property', |
238 | 238 | ) ) ) { |
239 | - unset( $css[ $media_query ][ $element ][ $property ] ); |
|
240 | - $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; |
|
241 | - $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; |
|
242 | - $css[ $media_query ][ $element ][ $property ] = $value; |
|
239 | + unset( $css[$media_query][$element][$property] ); |
|
240 | + $css[$media_query][$element]['-webkit-' . $property] = $value; |
|
241 | + $css[$media_query][$element]['-moz-' . $property] = $value; |
|
242 | + $css[$media_query][$element][$property] = $value; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | // Add -ms-* and -o-*. |
@@ -249,10 +249,10 @@ discard block |
||
249 | 249 | 'transition', |
250 | 250 | 'transition-property', |
251 | 251 | ) ) ) { |
252 | - unset( $css[ $media_query ][ $element ][ $property ] ); |
|
253 | - $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; |
|
254 | - $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; |
|
255 | - $css[ $media_query ][ $element ][ $property ] = $value; |
|
252 | + unset( $css[$media_query][$element][$property] ); |
|
253 | + $css[$media_query][$element]['-ms-' . $property] = $value; |
|
254 | + $css[$media_query][$element]['-o-' . $property] = $value; |
|
255 | + $css[$media_query][$element][$property] = $value; |
|
256 | 256 | } |
257 | 257 | } |
258 | 258 | } |
@@ -185,11 +185,11 @@ |
||
185 | 185 | |
186 | 186 | // Only continue if $field['output'] is set. |
187 | 187 | if ( isset( $field['output'] ) && ! empty( $field['output'] ) && 'background' != $field['type'] ) { |
188 | - $css = Kirki_Helper::array_replace_recursive( $css, Kirki_Modules_CSS_Generator::css( $field ) ); |
|
188 | + $css = Kirki_Helper::array_replace_recursive( $css, Kirki_Modules_CSS_Generator::css( $field ) ); |
|
189 | 189 | |
190 | 190 | // Add the globals. |
191 | - if ( isset( self::$css_array[ $config_id ] ) && ! empty( self::$css_array[ $config_id ] ) ) { |
|
192 | - Kirki_Helper::array_replace_recursive( $css, self::$css_array[ $config_id ] ); |
|
191 | + if ( isset( self::$css_array[$config_id] ) && ! empty( self::$css_array[$config_id] ) ) { |
|
192 | + Kirki_Helper::array_replace_recursive( $css, self::$css_array[$config_id] ); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | } |