@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | |
35 | 35 | foreach ( $args['fields'] as $key => $value ) { |
36 | 36 | if ( ! isset( $value['default'] ) ) { |
37 | - $args['fields'][ $key ]['default'] = ''; |
|
37 | + $args['fields'][$key]['default'] = ''; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | if ( ! isset( $value['label'] ) ) { |
41 | - $args['fields'][ $key ]['label'] = ''; |
|
41 | + $args['fields'][$key]['label'] = ''; |
|
42 | 42 | } |
43 | - $args['fields'][ $key ]['id'] = $key; |
|
43 | + $args['fields'][$key]['id'] = $key; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $this->fields = $args['fields']; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | - $fields[ $key ]['buttonLabels'] = $default_image_button_labels; |
|
66 | + $fields[$key]['buttonLabels'] = $default_image_button_labels; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | $this->json['fields'] = $fields; |
@@ -26,15 +26,15 @@ |
||
26 | 26 | if ( is_array( $this->choices ) ) { |
27 | 27 | foreach ( $this->choices as $choice => $value ) { |
28 | 28 | if ( true === $value ) { |
29 | - $this->json['choices'][ $choice ] = true; |
|
29 | + $this->json['choices'][$choice] = true; |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | 34 | if ( is_array( $this->json['default'] ) ) { |
35 | 35 | foreach ( $this->json['default'] as $key => $value ) { |
36 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
37 | - $this->json['value'][ $key ] = $value; |
|
36 | + if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) { |
|
37 | + $this->json['value'][$key] = $value; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | * then use the 'output' argument to auto-generate the js_vars |
54 | 54 | */ |
55 | 55 | $config_id = ( isset( $args['kirki_config'] ) ) ? $args['kirki_config'] : 'global'; |
56 | - if ( isset( Kirki::$config[ $config_id ]['postMessage'] ) && 'auto' == Kirki::$config[ $config_id ]['postMessage'] ) { |
|
56 | + if ( isset( Kirki::$config[$config_id]['postMessage'] ) && 'auto' == Kirki::$config[$config_id]['postMessage'] ) { |
|
57 | 57 | if ( ! isset( $args['js_vars'] ) || empty( $args['js_vars'] ) ) { |
58 | 58 | if ( isset( $args['output'] ) ) { |
59 | 59 | $args['js_vars'] = $args['output']; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $defaults = isset( $args['default'] ) ? $args['default'] : array(); |
18 | 18 | $sanitize_callback = $args['sanitize_callback']; |
19 | 19 | foreach ( $settings as $setting_key => $setting_value ) { |
20 | - $default = ( isset( $defaults[ $setting_key ] ) ) ? $defaults[ $setting_key ] : ''; |
|
20 | + $default = ( isset( $defaults[$setting_key] ) ) ? $defaults[$setting_key] : ''; |
|
21 | 21 | $transport = isset( $args['transport'] ) ? $args['transport'] : 'refresh'; |
22 | 22 | |
23 | 23 | $this->wp_customize->add_setting( $setting_value, array( |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | if ( isset( $args['type'] ) && array_key_exists( $args['type'], Kirki_Control::$setting_types ) ) { |
34 | 34 | // We must instantiate a custom class for the setting |
35 | - $setting_classname = Kirki_Control::$setting_types[ $args['type'] ]; |
|
35 | + $setting_classname = Kirki_Control::$setting_types[$args['type']]; |
|
36 | 36 | $this->wp_customize->add_setting( new $setting_classname( $this->wp_customize, $args['settings'], array( |
37 | 37 | 'default' => isset( $args['default'] ) ? $args['default'] : '', |
38 | 38 | 'type' => $args['option_type'], |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | // get an md5 for this color |
78 | 78 | $color_md5 = ( is_array( $color ) ) ? md5( json_encode( $color ) . $mode ) : md5( $color . $mode ); |
79 | 79 | // Set the instance if it does not already exist. |
80 | - if ( ! isset( self::$instances[ $color_md5 ] ) ) { |
|
81 | - self::$instances[ $color_md5 ] = new self( $color, $mode ); |
|
80 | + if ( ! isset( self::$instances[$color_md5] ) ) { |
|
81 | + self::$instances[$color_md5] = new self( $color, $mode ); |
|
82 | 82 | } |
83 | - return self::$instances[ $color_md5 ]; |
|
83 | + return self::$instances[$color_md5]; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -172,10 +172,10 @@ discard block |
||
172 | 172 | 'opacity' => 'alpha', |
173 | 173 | ); |
174 | 174 | $found = false; |
175 | - foreach( $finders_keepers as $finder => $keeper ) { |
|
176 | - if ( isset( $color[ $finder ] ) ) { |
|
175 | + foreach ( $finders_keepers as $finder => $keeper ) { |
|
176 | + if ( isset( $color[$finder] ) ) { |
|
177 | 177 | $found = true; |
178 | - $this->$keeper = $color[ $finder ]; |
|
178 | + $this->$keeper = $color[$finder]; |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | // We failed, return null. |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | // Perhaps we're using a word like "orange"? |
205 | 205 | $wordcolors = $this->get_word_colors(); |
206 | 206 | if ( array_key_exists( $color, $wordcolors ) ) { |
207 | - $this->color = '#' . $wordcolors[ $color ]; |
|
207 | + $this->color = '#' . $wordcolors[$color]; |
|
208 | 208 | return 'hex'; |
209 | 209 | } |
210 | 210 | // fallback to hex. |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | // Is this perhaps a word-color? |
225 | 225 | $word_colors = $this->get_word_colors(); |
226 | 226 | if ( array_key_exists( $this->color, $word_colors ) ) { |
227 | - $this->color = '#' . $word_colors[ $this->color ]; |
|
227 | + $this->color = '#' . $word_colors[$this->color]; |
|
228 | 228 | } |
229 | 229 | // Sanitize color |
230 | 230 | $this->hex = sanitize_hex_color( maybe_hash_hex_color( $this->color ) ); |
@@ -356,9 +356,9 @@ discard block |
||
356 | 356 | * @see https://gist.github.com/brandonheyer/5254516 |
357 | 357 | */ |
358 | 358 | public function from_hsl_array() { |
359 | - $h = $this->hue /360; |
|
359 | + $h = $this->hue / 360; |
|
360 | 360 | $s = $this->saturation / 100; |
361 | - $l = $this->lightness /100; |
|
361 | + $l = $this->lightness / 100; |
|
362 | 362 | |
363 | 363 | $r = $l; |
364 | 364 | $g = $l; |
@@ -189,7 +189,7 @@ |
||
189 | 189 | return 'auto'; |
190 | 190 | } |
191 | 191 | // Return empty if there are no numbers in the value. |
192 | - if ( ! preg_match( '#[0-9]#' , $value ) ) { |
|
192 | + if ( ! preg_match( '#[0-9]#', $value ) ) { |
|
193 | 193 | return ''; |
194 | 194 | } |
195 | 195 | // The raw value without the units |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | '800' => esc_attr__( 'Extra-Bold 800', 'kirki' ), |
131 | 131 | '800italic' => esc_attr__( 'Extra-Bold 800 Italic', 'kirki' ), |
132 | 132 | '600italic' => esc_attr__( 'Semi-Bold 600 Italic', 'kirki' ), |
133 | - '200italic' => esc_attr__( 'Light 200 Italic', 'kirki' ), ); |
|
133 | + '200italic' => esc_attr__( 'Light 200 Italic', 'kirki' ),); |
|
134 | 134 | |
135 | 135 | $config = apply_filters( 'kirki/config', array() ); |
136 | 136 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public static function clean_file_path( $path ) { |
173 | 173 | $path = str_replace( '', '', str_replace( array( "\\", "\\\\" ), '/', $path ) ); |
174 | - if ( '/' === $path[ strlen( $path ) - 1 ] ) { |
|
174 | + if ( '/' === $path[strlen( $path ) - 1] ) { |
|
175 | 175 | $path = rtrim( $path, '/' ); |
176 | 176 | } |
177 | 177 | return $path; |
@@ -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; |