@@ -40,8 +40,8 @@ |
||
40 | 40 | |
41 | 41 | $previous_path = ''; |
42 | 42 | for ( $i = 0; $i < $levels; $i++ ) { |
43 | - $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename; |
|
44 | - $previous_path .= strtolower( $exploded[ $i ] ) . '/'; |
|
43 | + $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename; |
|
44 | + $previous_path .= strtolower( $exploded[$i] ) . '/'; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | foreach ( $paths as $path ) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | private function init() { |
78 | 78 | |
79 | 79 | foreach ( self::$modules as $module ) { |
80 | - self::$active_modules[ $module ] = new $module(); |
|
80 | + self::$active_modules[$module] = new $module(); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $key = array_search( $module, self::$modules, true ); |
112 | 112 | if ( false !== $key ) { |
113 | - unset( self::$modules[ $key ] ); |
|
113 | + unset( self::$modules[$key] ); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 |
@@ -158,7 +158,7 @@ |
||
158 | 158 | if ( is_array( $values ) && ! empty( $values ) ) { |
159 | 159 | foreach ( $values as $key => $value ) { |
160 | 160 | if ( array_key_exists( $value, $this->choices ) ) { |
161 | - $filtered_values[ $key ] = $value; |
|
161 | + $filtered_values[$key] = $value; |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 | } |
@@ -112,14 +112,14 @@ |
||
112 | 112 | if ( is_array( $this->choices ) ) { |
113 | 113 | foreach ( $this->choices as $choice => $value ) { |
114 | 114 | if ( true === $value ) { |
115 | - $this->json['choices'][ $choice ] = true; |
|
115 | + $this->json['choices'][$choice] = true; |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
119 | 119 | if ( is_array( $this->json['default'] ) ) { |
120 | 120 | foreach ( $this->json['default'] as $key => $value ) { |
121 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
122 | - $this->json['value'][ $key ] = $value; |
|
121 | + if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) { |
|
122 | + $this->json['value'][$key] = $value; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; |
128 | 128 | } |
129 | 129 | |
130 | - $this->json['palette'] = $this->palette; |
|
130 | + $this->json['palette'] = $this->palette; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -129,14 +129,14 @@ |
||
129 | 129 | $available_variants = array(); |
130 | 130 | foreach ( $variants as $variant ) { |
131 | 131 | if ( array_key_exists( $variant, $all_variants ) ) { |
132 | - $available_variants[] = array( 'id' => $variant, 'label' => $all_variants[ $variant ] ); |
|
132 | + $available_variants[] = array( 'id' => $variant, 'label' => $all_variants[$variant] ); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | 136 | $available_subsets = array(); |
137 | 137 | foreach ( $subsets as $subset ) { |
138 | 138 | if ( array_key_exists( $subset, $all_subsets ) ) { |
139 | - $available_subsets[] = array( 'id' => $subset, 'label' => $all_subsets[ $subset ] ); |
|
139 | + $available_subsets[] = array( 'id' => $subset, 'label' => $all_subsets[$subset] ); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | |
136 | 136 | // Validating row label field. |
137 | - if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) { |
|
137 | + if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][esc_attr( $args['row_label']['field'] )] ) ) { |
|
138 | 138 | $this->row_label['field'] = esc_attr( $args['row_label']['field'] ); |
139 | 139 | } else { |
140 | 140 | |
@@ -156,19 +156,19 @@ discard block |
||
156 | 156 | |
157 | 157 | foreach ( $args['fields'] as $key => $value ) { |
158 | 158 | if ( ! isset( $value['default'] ) ) { |
159 | - $args['fields'][ $key ]['default'] = ''; |
|
159 | + $args['fields'][$key]['default'] = ''; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | if ( ! isset( $value['label'] ) ) { |
163 | - $args['fields'][ $key ]['label'] = ''; |
|
163 | + $args['fields'][$key]['label'] = ''; |
|
164 | 164 | } |
165 | - $args['fields'][ $key ]['id'] = $key; |
|
165 | + $args['fields'][$key]['id'] = $key; |
|
166 | 166 | |
167 | 167 | // We check if the filed is an uploaded media ( image , file, video, etc.. ). |
168 | 168 | if ( isset( $value['type'] ) && ( 'image' === $value['type'] || 'cropped_image' === $value['type'] || 'upload' === $value['type'] ) ) { |
169 | 169 | |
170 | 170 | // We add it to the list of fields that need some extra filtering/processing. |
171 | - $media_fields_to_filter[ $key ] = true; |
|
171 | + $media_fields_to_filter[$key] = true; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | // If the field is a dropdown-pages field then add it to args. |
@@ -185,9 +185,9 @@ discard block |
||
185 | 185 | ); |
186 | 186 | |
187 | 187 | // Hackily add in the data link parameter. |
188 | - $dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown ); |
|
188 | + $dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][$key]['id'] ) . '"' . $this->get_link(), $dropdown ); |
|
189 | 189 | |
190 | - $args['fields'][ $key ]['dropdown'] = $dropdown; |
|
190 | + $args['fields'][$key]['dropdown'] = $dropdown; |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 |
@@ -50,9 +50,9 @@ |
||
50 | 50 | // Make sure that every row is an array, not an object |
51 | 51 | foreach ( $sanitized as $key => $_value ) { |
52 | 52 | if ( empty( $_value ) ) { |
53 | - unset( $sanitized[ $key ] ); |
|
53 | + unset( $sanitized[$key] ); |
|
54 | 54 | } else { |
55 | - $sanitized[ $key ] = (array) $_value; |
|
55 | + $sanitized[$key] = (array) $_value; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 |
@@ -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_Output_Generator::css( $field ) ); |
|
188 | + $css = Kirki_Helper::array_replace_recursive( $css, Kirki_Modules_CSS_Output_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 | } |