@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | |
112 | 112 | foreach ( $args['fields'] as $key => $value ) { |
113 | 113 | if ( ! isset( $value['default'] ) ) { |
114 | - $args['fields'][ $key ]['default'] = ''; |
|
114 | + $args['fields'][$key]['default'] = ''; |
|
115 | 115 | } |
116 | 116 | if ( ! isset( $value['label'] ) ) { |
117 | - $args['fields'][ $key ]['label'] = ''; |
|
117 | + $args['fields'][$key]['label'] = ''; |
|
118 | 118 | } |
119 | - $args['fields'][ $key ]['id'] = $key; |
|
119 | + $args['fields'][$key]['id'] = $key; |
|
120 | 120 | |
121 | 121 | // We check if the filed is an uploaded media ( image , file, video, etc.. ). |
122 | 122 | if ( isset( $value['type'] ) ) { |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | case 'cropped_image': |
126 | 126 | case 'upload': |
127 | 127 | // We add it to the list of fields that need some extra filtering/processing. |
128 | - $media_fields_to_filter[ $key ] = true; |
|
128 | + $media_fields_to_filter[$key] = true; |
|
129 | 129 | break; |
130 | 130 | |
131 | 131 | case 'dropdown-pages': |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | ) |
141 | 141 | ); |
142 | 142 | // Hackily add in the data link parameter. |
143 | - $dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown ); |
|
144 | - $args['fields'][ $key ]['dropdown'] = $dropdown; |
|
143 | + $dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][$key]['id'] ) . '"' . $this->get_link(), $dropdown ); |
|
144 | + $args['fields'][$key]['dropdown'] = $dropdown; |
|
145 | 145 | break; |
146 | 146 | } |
147 | 147 | } |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | // Validating row label field. |
558 | - if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) { |
|
558 | + if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][esc_attr( $args['row_label']['field'] )] ) ) { |
|
559 | 559 | $this->row_label['field'] = esc_attr( $args['row_label']['field'] ); |
560 | 560 | } else { |
561 | 561 | // If from field is not set correctly, making sure standard is set as the type. |
@@ -591,6 +591,6 @@ discard block |
||
591 | 591 | if ( false === $id ) { |
592 | 592 | return $translation_strings; |
593 | 593 | } |
594 | - return $translation_strings[ $id ]; |
|
594 | + return $translation_strings[$id]; |
|
595 | 595 | } |
596 | 596 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $property = $output['property'] . '-' . $key; |
36 | 36 | } |
37 | 37 | $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; |
38 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value; |
|
38 | + $this->styles[$output['media_query']][$output['element']][$property] = $sub_value; |
|
39 | 39 | |
40 | 40 | } |
41 | 41 | } |
@@ -38,14 +38,14 @@ |
||
38 | 38 | // Add backup font. |
39 | 39 | if ( Kirki_Fonts::is_google_font( $this->value ) ) { |
40 | 40 | |
41 | - if ( isset( $google_fonts_array[ $this->value ] ) && isset( $google_fonts_array[ $this->value ]['category'] ) ) { |
|
42 | - if ( isset( $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ] ) ) { |
|
41 | + if ( isset( $google_fonts_array[$this->value] ) && isset( $google_fonts_array[$this->value]['category'] ) ) { |
|
42 | + if ( isset( $backup_fonts[$google_fonts_array[$this->value]['category']] ) ) { |
|
43 | 43 | |
44 | 44 | // Add double quotes if needed. |
45 | 45 | if ( false !== strpos( $this->value, ' ' ) && false === strpos( $this->value, '"' ) ) { |
46 | - $this->value = '"' . $this->value . '", ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
46 | + $this->value = '"' . $this->value . '", ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
47 | 47 | } else { |
48 | - $this->value .= ', ' . $backup_fonts[ $google_fonts_array[ $this->value ]['category'] ]; |
|
48 | + $this->value .= ', ' . $backup_fonts[$google_fonts_array[$this->value]['category']]; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
@@ -52,7 +52,7 @@ |
||
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 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $section_classname = 'WP_Customize_Section'; |
51 | 51 | |
52 | 52 | if ( isset( $args['type'] ) && array_key_exists( $args['type'], $this->section_types ) ) { |
53 | - $section_classname = $this->section_types[ $args['type'] ]; |
|
53 | + $section_classname = $this->section_types[$args['type']]; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // Add the section. |
@@ -49,7 +49,7 @@ |
||
49 | 49 | if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) { |
50 | 50 | $args['type'] = 'default'; |
51 | 51 | } |
52 | - $panel_classname = $this->panel_types[ $args['type'] ]; |
|
52 | + $panel_classname = $this->panel_types[$args['type']]; |
|
53 | 53 | |
54 | 54 | $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) ); |
55 | 55 |
@@ -70,9 +70,9 @@ |
||
70 | 70 | // Make sure that every row is an array, not an object. |
71 | 71 | foreach ( $sanitized as $key => $_value ) { |
72 | 72 | if ( empty( $_value ) ) { |
73 | - unset( $sanitized[ $key ] ); |
|
73 | + unset( $sanitized[$key] ); |
|
74 | 74 | } else { |
75 | - $sanitized[ $key ] = (array) $_value; |
|
75 | + $sanitized[$key] = (array) $_value; |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | $sanitized_value = array(); |
54 | 54 | foreach ( $value as $sub_value ) { |
55 | - if ( isset( $this->choices[ $sub_value ] ) ) { |
|
55 | + if ( isset( $this->choices[$sub_value] ) ) { |
|
56 | 56 | $sanitized_value[] = esc_attr( $sub_value ); |
57 | 57 | } |
58 | 58 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | } |
43 | 43 | $count = count( $args ); |
44 | 44 | for ( $i = 1; $i < $count; $i++ ) { |
45 | - if ( is_array( $args[ $i ] ) ) { |
|
46 | - $array = self::recurse( $array, $args[ $i ] ); |
|
45 | + if ( is_array( $args[$i] ) ) { |
|
46 | + $array = self::recurse( $array, $args[$i] ); |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | return $array; |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | public static function recurse( $array, $array1 ) { |
62 | 62 | foreach ( $array1 as $key => $value ) { |
63 | 63 | // Create new key in $array, if it is empty or not an array. |
64 | - if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { |
|
65 | - $array[ $key ] = array(); |
|
64 | + if ( ! isset( $array[$key] ) || ( isset( $array[$key] ) && ! is_array( $array[$key] ) ) ) { |
|
65 | + $array[$key] = array(); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // Overwrite the value in the base array. |
69 | 69 | if ( is_array( $value ) ) { |
70 | - $value = self::recurse( $array[ $key ], $value ); |
|
70 | + $value = self::recurse( $array[$key], $value ); |
|
71 | 71 | } |
72 | - $array[ $key ] = $value; |
|
72 | + $array[$key] = $value; |
|
73 | 73 | } |
74 | 74 | return $array; |
75 | 75 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | // Properly format the array. |
152 | 152 | $items = array(); |
153 | 153 | foreach ( $posts as $post ) { |
154 | - $items[ $post->ID ] = $post->post_title; |
|
154 | + $items[$post->ID] = $post->post_title; |
|
155 | 155 | } |
156 | 156 | wp_reset_postdata(); |
157 | 157 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | foreach ( $taxonomies as $taxonomy ) { |
178 | 178 | $id = $taxonomy; |
179 | 179 | $taxonomy = get_taxonomy( $taxonomy ); |
180 | - $items[ $id ] = $taxonomy->labels->name; |
|
180 | + $items[$id] = $taxonomy->labels->name; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | return $items; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | |
201 | 201 | // Build the array. |
202 | 202 | foreach ( $post_types as $post_type ) { |
203 | - $items[ $post_type->name ] = $post_type->labels->name; |
|
203 | + $items[$post_type->name] = $post_type->labels->name; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | return $items; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | |
225 | 225 | // Build the array. |
226 | 226 | foreach ( $terms as $term ) { |
227 | - $items[ $term->term_id ] = $term->name; |
|
227 | + $items[$term->term_id] = $term->name; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return $items; |
@@ -595,8 +595,8 @@ discard block |
||
595 | 595 | unset( $colors['primary'] ); |
596 | 596 | $position_colors = array(); |
597 | 597 | foreach ( $colors as $color_family ) { |
598 | - if ( isset( $color_family[ $key ] ) ) { |
|
599 | - $position_colors[] = $color_family[ $key ]; |
|
598 | + if ( isset( $color_family[$key] ) ) { |
|
599 | + $position_colors[] = $color_family[$key]; |
|
600 | 600 | } |
601 | 601 | } |
602 | 602 | return $position_colors; |
@@ -612,8 +612,8 @@ discard block |
||
612 | 612 | case 'primary': |
613 | 613 | return $colors['primary']; |
614 | 614 | default: |
615 | - if ( isset( $colors[ $context ] ) ) { |
|
616 | - return $colors[ $context ]; |
|
615 | + if ( isset( $colors[$context] ) ) { |
|
616 | + return $colors[$context]; |
|
617 | 617 | } |
618 | 618 | return $colors['primary']; |
619 | 619 | } |