@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | 'family' => $value['stack'], |
75 | 75 | 'label' => $value['label'], |
76 | 76 | 'variants' => array( |
77 | - array( 'id' => 'regular', 'label' => $all_variants['regular'] ), |
|
78 | - array( 'id' => 'italic', 'label' => $all_variants['italic'] ), |
|
79 | - array( 'id' => '700', 'label' => $all_variants['700'] ), |
|
77 | + array( 'id' => 'regular', 'label' => $all_variants['regular'] ), |
|
78 | + array( 'id' => 'italic', 'label' => $all_variants['italic'] ), |
|
79 | + array( 'id' => '700', 'label' => $all_variants['700'] ), |
|
80 | 80 | array( 'id' => '700italic', 'label' => $all_variants['700italic'] ), |
81 | 81 | ), |
82 | 82 | 'subsets' => array(), |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | $available_variants = array(); |
94 | 94 | foreach ( $variants as $variant ) { |
95 | 95 | if ( array_key_exists( $variant, $all_variants ) ) { |
96 | - $available_variants[] = array( 'id' => $variant, 'label' => $all_variants[ $variant ] ); |
|
96 | + $available_variants[] = array( 'id' => $variant, 'label' => $all_variants[$variant] ); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | 100 | $available_subsets = array(); |
101 | 101 | foreach ( $subsets as $subset ) { |
102 | 102 | if ( array_key_exists( $subset, $all_subsets ) ) { |
103 | - $available_subsets[] = array( 'id' => $subset, 'label' => $all_subsets[ $subset ] ); |
|
103 | + $available_subsets[] = array( 'id' => $subset, 'label' => $all_subsets[$subset] ); |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | } |
28 | 28 | $count = count( $args ); |
29 | 29 | for ( $i = 1; $i < $count; $i++ ) { |
30 | - if ( is_array( $args[ $i ] ) ) { |
|
31 | - $array = self::recurse( $array, $args[ $i ] ); |
|
30 | + if ( is_array( $args[$i] ) ) { |
|
31 | + $array = self::recurse( $array, $args[$i] ); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | return $array; |
@@ -37,15 +37,15 @@ discard block |
||
37 | 37 | public static function recurse( $array, $array1 ) { |
38 | 38 | foreach ( $array1 as $key => $value ) { |
39 | 39 | // create new key in $array, if it is empty or not an array |
40 | - if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { |
|
41 | - $array[ $key ] = array(); |
|
40 | + if ( ! isset( $array[$key] ) || ( isset( $array[$key] ) && ! is_array( $array[$key] ) ) ) { |
|
41 | + $array[$key] = array(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // overwrite the value in the base array |
45 | 45 | if ( is_array( $value ) ) { |
46 | - $value = self::recurse( $array[ $key ], $value ); |
|
46 | + $value = self::recurse( $array[$key], $value ); |
|
47 | 47 | } |
48 | - $array[ $key ] = $value; |
|
48 | + $array[$key] = $value; |
|
49 | 49 | } |
50 | 50 | return $array; |
51 | 51 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // properly format the array. |
103 | 103 | $items = array(); |
104 | 104 | foreach ( $posts as $post ) { |
105 | - $items[ $post->ID ] = $post->post_title; |
|
105 | + $items[$post->ID] = $post->post_title; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return $items; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | foreach ( $taxonomies as $taxonomy ) { |
120 | 120 | $id = $taxonomy; |
121 | 121 | $taxonomy = get_taxonomy( $taxonomy ); |
122 | - $items[ $id ] = $taxonomy->labels->name; |
|
122 | + $items[$id] = $taxonomy->labels->name; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | return $items; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $post_types = get_post_types( array( 'public' => true ), 'objects' ); |
135 | 135 | // Build the array |
136 | 136 | foreach ( $post_types as $post_type ) { |
137 | - $items[ $post_type->name ] = $post_type->labels->name; |
|
137 | + $items[$post_type->name] = $post_type->labels->name; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return $items; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $terms = get_terms( $taxonomies ); |
150 | 150 | // Build the array |
151 | 151 | foreach ( $terms as $term ) { |
152 | - $items[ $term->term_id ] = $term->name; |
|
152 | + $items[$term->term_id] = $term->name; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | return $items; |
@@ -113,8 +113,8 @@ |
||
113 | 113 | } |
114 | 114 | $css = $array_replace_recursive( $css, Kirki_Styles_Output_CSS::css( $field ) ); |
115 | 115 | // Add the globals |
116 | - if ( isset( self::$css_array[ $config_id ] ) && ! empty( self::$css_array[ $config_id ] ) ) { |
|
117 | - $array_replace_recursive( $css, self::$css_array[ $config_id ] ); |
|
116 | + if ( isset( self::$css_array[$config_id] ) && ! empty( self::$css_array[$config_id] ) ) { |
|
117 | + $array_replace_recursive( $css, self::$css_array[$config_id] ); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | } |
@@ -9,13 +9,13 @@ |
||
9 | 9 | // Add backup font |
10 | 10 | if ( Kirki_Fonts::is_google_font( $this->value ) ) { |
11 | 11 | |
12 | - if ( isset( $google_fonts_array[ $this->value ] ) && isset( $google_fonts_array[ $this->value ]['category'] ) ) { |
|
13 | - if ( isset( $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ] ) ) { |
|
12 | + if ( isset( $google_fonts_array[$this->value] ) && isset( $google_fonts_array[$this->value]['category'] ) ) { |
|
13 | + if ( isset( $backup_fonts[$google_fonts_array[$this->value]['category']] ) ) { |
|
14 | 14 | // add double quotes if needed |
15 | 15 | if ( false !== strpos( $this->value, ' ' ) && false === strpos( $this->value, '"' ) ) { |
16 | - $this->value = '"' . $this->value . '", ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
16 | + $this->value = '"' . $this->value . '", ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
17 | 17 | } else { |
18 | - $this->value .= ', ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
18 | + $this->value .= ', ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | |
7 | 7 | // Take care of font-families |
8 | 8 | if ( isset( $value['font-family'] ) ) { |
9 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-family'] = $this->process_property_value( 'font-family', $value['font-family'] ); |
|
9 | + $this->styles[$output['media_query']][$output['element']]['font-family'] = $this->process_property_value( 'font-family', $value['font-family'] ); |
|
10 | 10 | } |
11 | 11 | // Add support for the older font-weight parameter. |
12 | 12 | // This has been deprecated so the code below is just |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // and make changes to their typography, |
16 | 16 | // new values are saved and this one is no longer used. |
17 | 17 | if ( isset( $value['font-weight'] ) && $value['font-weight'] ) { |
18 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $value['font-weight']; |
|
18 | + $this->styles[$output['media_query']][$output['element']]['font-weight'] = $value['font-weight']; |
|
19 | 19 | } |
20 | 20 | // Take care of variants |
21 | 21 | if ( isset( $value['variant'] ) && $value['variant'] ) { |
@@ -24,22 +24,22 @@ discard block |
||
24 | 24 | $font_weight = ( in_array( $font_weight, array( '', 'regular' ) ) ) ? '400' : $font_weight; |
25 | 25 | // Is this italic? |
26 | 26 | $is_italic = ( false !== strpos( $value['variant'], 'italic' ) ); |
27 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight; |
|
27 | + $this->styles[$output['media_query']][$output['element']]['font-weight'] = $font_weight; |
|
28 | 28 | if ( $is_italic ) { |
29 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic'; |
|
29 | + $this->styles[$output['media_query']][$output['element']]['font-style'] = 'italic'; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | // Take care of font-size |
33 | 33 | if ( isset( $value['font-size'] ) ) { |
34 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['font-size'] = $value['font-size']; |
|
34 | + $this->styles[$output['media_query']][$output['element']]['font-size'] = $value['font-size']; |
|
35 | 35 | } |
36 | 36 | // Take care of line-height |
37 | 37 | if ( isset( $value['line-height'] ) ) { |
38 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['line-height'] = $value['line-height']; |
|
38 | + $this->styles[$output['media_query']][$output['element']]['line-height'] = $value['line-height']; |
|
39 | 39 | } |
40 | 40 | // Take care of letter-spacing |
41 | 41 | if ( isset( $value['letter-spacing'] ) ) { |
42 | - $this->styles[ $output['media_query'] ][ $output['element'] ]['letter-spacing'] = $value['letter-spacing']; |
|
42 | + $this->styles[$output['media_query']][$output['element']]['letter-spacing'] = $value['letter-spacing']; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'typography' => 'Kirki_Output_Control_Typography', |
97 | 97 | ) ); |
98 | 98 | if ( array_key_exists( self::$field_type, $field_output_classes ) ) { |
99 | - $classname = $field_output_classes[ self::$field_type ]; |
|
99 | + $classname = $field_output_classes[self::$field_type]; |
|
100 | 100 | } |
101 | 101 | $obj = new $classname( $field['kirki_config'], self::$output, self::$value ); |
102 | 102 | return $obj->get_styles(); |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | 'transition', |
173 | 173 | 'transition-property', |
174 | 174 | ) ) ) { |
175 | - $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; |
|
176 | - $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; |
|
175 | + $css[$media_query][$element]['-webkit-' . $property] = $value; |
|
176 | + $css[$media_query][$element]['-moz-' . $property] = $value; |
|
177 | 177 | } |
178 | 178 | /** |
179 | 179 | * Add -ms-* and -o-* |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | 'transition', |
185 | 185 | 'transition-property', |
186 | 186 | ) ) ) { |
187 | - $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; |
|
188 | - $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; |
|
187 | + $css[$media_query][$element]['-ms-' . $property] = $value; |
|
188 | + $css[$media_query][$element]['-o-' . $property] = $value; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | } |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | // Add the requested google-font |
100 | - if ( ! isset( $this->fonts[ $value['font-family'] ] ) ) { |
|
101 | - $this->fonts[ $value['font-family'] ] = array(); |
|
100 | + if ( ! isset( $this->fonts[$value['font-family']] ) ) { |
|
101 | + $this->fonts[$value['font-family']] = array(); |
|
102 | 102 | } |
103 | - if ( ! in_array( $value['variant'], $this->fonts[ $value['font-family'] ] ) ) { |
|
104 | - $this->fonts[ $value['font-family'] ][] = $value['variant']; |
|
103 | + if ( ! in_array( $value['variant'], $this->fonts[$value['font-family']] ) ) { |
|
104 | + $this->fonts[$value['font-family']][] = $value['variant']; |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if ( isset( $args['output'] ) && is_array( $args['output'] ) ) { |
113 | 113 | foreach ( $args['output'] as $output ) { |
114 | 114 | // If we don't have a typography-related output argument we can skip this. |
115 | - if ( ! isset( $output['property'] ) || ! in_array( $output['property'], array( 'font-family', 'font-weight', 'font-subset', 'subset' ) ) ) { |
|
115 | + if ( ! isset( $output['property'] ) || ! in_array( $output['property'], array( 'font-family', 'font-weight', 'font-subset', 'subset' ) ) ) { |
|
116 | 116 | continue; |
117 | 117 | } |
118 | 118 | // Get the value |
@@ -121,14 +121,14 @@ discard block |
||
121 | 121 | // font-family |
122 | 122 | if ( 'font-family' == $output['property'] ) { |
123 | 123 | if ( ! array_key_exists( $value, $this->fonts ) ) { |
124 | - $this->fonts[ $value ] = array(); |
|
124 | + $this->fonts[$value] = array(); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | // font-weight |
128 | 128 | elseif ( 'font-weight' == $output['property'] ) { |
129 | 129 | foreach ( $this->fonts as $font => $variants ) { |
130 | 130 | if ( ! in_array( $value, $variants ) ) { |
131 | - $this->fonts[ $font ][] = $value; |
|
131 | + $this->fonts[$font][] = $value; |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -165,27 +165,27 @@ discard block |
||
165 | 165 | // Determine if this is indeed a google font or not. |
166 | 166 | // If it's not, then just remove it from the array. |
167 | 167 | if ( ! array_key_exists( $font, $google_fonts ) ) { |
168 | - unset( $this->fonts[ $font ] ); |
|
168 | + unset( $this->fonts[$font] ); |
|
169 | 169 | continue; |
170 | 170 | } |
171 | 171 | // Get all valid font variants for this font |
172 | 172 | $font_variants = array(); |
173 | - if ( isset( $google_fonts[ $font ]['variants'] ) ) { |
|
174 | - $font_variants = $google_fonts[ $font ]['variants']; |
|
173 | + if ( isset( $google_fonts[$font]['variants'] ) ) { |
|
174 | + $font_variants = $google_fonts[$font]['variants']; |
|
175 | 175 | } |
176 | 176 | foreach ( $variants as $variant ) { |
177 | 177 | // If this is not a valid variant for this font-family |
178 | 178 | // then unset it and move on to the next one. |
179 | 179 | if ( ! in_array( $variant, $font_variants ) ) { |
180 | - unset( $this->fonts[ $font ][ $variant ] ); |
|
180 | + unset( $this->fonts[$font][$variant] ); |
|
181 | 181 | continue; |
182 | 182 | } |
183 | 183 | } |
184 | 184 | // Check if the selected subsets exist, even in one of the selected fonts. |
185 | 185 | // If they don't, then they have to be removed otherwise the link will fail. |
186 | - if ( isset( $google_fonts[ $font ]['subsets'] ) ) { |
|
186 | + if ( isset( $google_fonts[$font]['subsets'] ) ) { |
|
187 | 187 | foreach ( $this->subsets as $subset ) { |
188 | - if ( in_array( $subset, $google_fonts[ $font ]['subsets'] ) ) { |
|
188 | + if ( in_array( $subset, $google_fonts[$font]['subsets'] ) ) { |
|
189 | 189 | $valid_subsets[] = $subset; |
190 | 190 | } |
191 | 191 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | } else { |
11 | 11 | $property = $output['property'] . '-' . $key; |
12 | 12 | } |
13 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value; |
|
13 | + $this->styles[$output['media_query']][$output['element']][$property] = $sub_value; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->section_types ) ) { |
26 | 26 | $args['type'] = 'default'; |
27 | 27 | } |
28 | - $section_classname = $this->section_types[ $args['type'] ]; |
|
28 | + $section_classname = $this->section_types[$args['type']]; |
|
29 | 29 | |
30 | 30 | $this->wp_customize->add_section( new $section_classname( $this->wp_customize, sanitize_key( $args['id'] ), array( |
31 | 31 | 'title' => $args['title'], // already escaped in WP Core |