@@ -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 | ); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $google_fonts = array(); |
101 | 101 | if ( is_array( $fonts ) ) { |
102 | 102 | foreach ( $fonts['items'] as $font ) { |
103 | - $google_fonts[ $font['family'] ] = array( |
|
103 | + $google_fonts[$font['family']] = array( |
|
104 | 104 | 'label' => $font['family'], |
105 | 105 | 'variants' => $font['variants'], |
106 | 106 | 'subsets' => $font['subsets'], |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $fonts = self::get_all_fonts(); |
176 | 176 | $fonts_array = array(); |
177 | 177 | foreach ( $fonts as $key => $args ) { |
178 | - $fonts_array[ $key ] = $key; |
|
178 | + $fonts_array[$key] = $key; |
|
179 | 179 | } |
180 | 180 | return $fonts_array; |
181 | 181 | } |
@@ -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 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
57 | 57 | |
58 | 58 | // Create the styles. |
59 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $sub_value . $output['suffix']; |
|
59 | + $this->styles[$output['media_query']][$output['element']][$output['property']] = $sub_value . $output['suffix']; |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // Take care of font-families. |
33 | 33 | if ( isset( $value['font-family'] ) && ! empty( $value['font-family'] ) ) { |
34 | 34 | $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
35 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-family'] = $output['prefix'] . $this->process_property_value( 'font-family', $value['font-family'] ) . $output['suffix']; |
|
35 | + $this->styles[$output['media_query']][$output['element']]['font-family'] = $output['prefix'] . $this->process_property_value( 'font-family', $value['font-family'] ) . $output['suffix']; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | // Add support for the older font-weight parameter. |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // Once a user visits their customizer and make changes to their typography, |
41 | 41 | // new values are saved and this one is no longer used. |
42 | 42 | if ( isset( $value['font-weight'] ) && ! empty( $value['font-weight'] ) ) { |
43 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $output['prefix'] . $value['font-weight'] . $output['suffix']; |
|
43 | + $this->styles[$output['media_query']][$output['element']]['font-weight'] = $output['prefix'] . $value['font-weight'] . $output['suffix']; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // Take care of variants. |
@@ -52,44 +52,44 @@ discard block |
||
52 | 52 | |
53 | 53 | // Is this italic? |
54 | 54 | $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); |
55 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $output['prefix'] . $font_weight . $output['suffix']; |
|
56 | - $font_style = $is_italic ? 'italic' : 'normal' ; |
|
57 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = $output['prefix'] . $font_style . $output['suffix']; |
|
55 | + $this->styles[$output['media_query']][$output['element']]['font-weight'] = $output['prefix'] . $font_weight . $output['suffix']; |
|
56 | + $font_style = $is_italic ? 'italic' : 'normal'; |
|
57 | + $this->styles[$output['media_query']][$output['element']]['font-style'] = $output['prefix'] . $font_style . $output['suffix']; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Take care of font-size. |
61 | 61 | if ( isset( $value['font-size'] ) && ! empty( $value['font-size'] ) ) { |
62 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-size'] = $output['prefix'] . $value['font-size'] . $output['suffix']; |
|
62 | + $this->styles[$output['media_query']][$output['element']]['font-size'] = $output['prefix'] . $value['font-size'] . $output['suffix']; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | // Take care of line-height. |
66 | 66 | if ( isset( $value['line-height'] ) && ! empty( $value['line-height'] ) ) { |
67 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['line-height'] = $output['prefix'] . $value['line-height'] . $output['suffix']; |
|
67 | + $this->styles[$output['media_query']][$output['element']]['line-height'] = $output['prefix'] . $value['line-height'] . $output['suffix']; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // Take care of letter-spacing. |
71 | 71 | if ( isset( $value['letter-spacing'] ) && ( ! empty( $value['letter-spacing'] ) || '0' == $value['letter-spacing'] ) ) { |
72 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['letter-spacing'] = $output['prefix'] . $value['letter-spacing'] . $output['suffix']; |
|
72 | + $this->styles[$output['media_query']][$output['element']]['letter-spacing'] = $output['prefix'] . $value['letter-spacing'] . $output['suffix']; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | // Take care of word-spacing. |
76 | 76 | if ( isset( $value['word-spacing'] ) && ( ! empty( $value['word-spacing'] ) || '0' == $value['word-spacing'] ) ) { |
77 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['word-spacing'] = $output['prefix'] . $value['word-spacing'] . $output['suffix']; |
|
77 | + $this->styles[$output['media_query']][$output['element']]['word-spacing'] = $output['prefix'] . $value['word-spacing'] . $output['suffix']; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // Take care of text-align. |
81 | 81 | if ( isset( $value['text-align'] ) && ! empty( $value['text-align'] ) ) { |
82 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['text-align'] = $output['prefix'] . $value['text-align'] . $output['suffix']; |
|
82 | + $this->styles[$output['media_query']][$output['element']]['text-align'] = $output['prefix'] . $value['text-align'] . $output['suffix']; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | // Take care of text-transform. |
86 | 86 | if ( isset( $value['text-transform'] ) && ! empty( $value['text-transform'] ) ) { |
87 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['text-transform'] = $output['prefix'] . $value['text-transform'] . $output['suffix']; |
|
87 | + $this->styles[$output['media_query']][$output['element']]['text-transform'] = $output['prefix'] . $value['text-transform'] . $output['suffix']; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | // Take care of color. |
91 | 91 | if ( isset( $value['color'] ) && ! empty( $value['color'] ) ) { |
92 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['color'] = $output['prefix'] . $value['color'] . $output['suffix']; |
|
92 | + $this->styles[$output['media_query']][$output['element']]['color'] = $output['prefix'] . $value['color'] . $output['suffix']; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $property = $output['property'] . '-' . $key; |
25 | 25 | } |
26 | 26 | $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
27 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value; |
|
27 | + $this->styles[$output['media_query']][$output['element']][$property] = $sub_value; |
|
28 | 28 | } |
29 | 29 | } |
30 | 30 | } |