@@ -67,9 +67,9 @@ |
||
67 | 67 | |
68 | 68 | // Make sure that every row is an array, not an object. |
69 | 69 | foreach ( $sanitized as $key => $_value ) { |
70 | - $sanitized[ $key ] = (array) $_value; |
|
70 | + $sanitized[$key] = (array) $_value; |
|
71 | 71 | if ( empty( $_value ) ) { |
72 | - unset( $sanitized[ $key ] ); |
|
72 | + unset( $sanitized[$key] ); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 |
@@ -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 | } |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | } |
582 | 582 | |
583 | 583 | // Validating row label field. |
584 | - if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) { |
|
584 | + if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][esc_attr( $args['row_label']['field'] )] ) ) { |
|
585 | 585 | $this->row_label['field'] = esc_attr( $args['row_label']['field'] ); |
586 | 586 | } else { |
587 | 587 | // If from field is not set correctly, making sure standard is set as the type. |
@@ -79,14 +79,14 @@ |
||
79 | 79 | if ( is_array( $this->choices ) ) { |
80 | 80 | foreach ( $this->choices as $choice => $value ) { |
81 | 81 | if ( 'labels' !== $choice && true === $value ) { |
82 | - $this->json['choices'][ $choice ] = true; |
|
82 | + $this->json['choices'][$choice] = true; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
86 | 86 | if ( is_array( $this->json['default'] ) ) { |
87 | 87 | foreach ( $this->json['default'] as $key => $value ) { |
88 | - if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) { |
|
89 | - $this->json['value'][ $key ] = $value; |
|
88 | + if ( isset( $this->json['choices'][$key] ) && ! isset( $this->json['value'][$key] ) ) { |
|
89 | + $this->json['value'][$key] = $value; |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // Check if we've got it cached and ready. |
57 | - if ( isset( $this->cached_paths[ $class_name ] ) && file_exists( $this->cached_paths[ $class_name ] ) ) { |
|
58 | - include_once $this->cached_paths[ $class_name ]; |
|
57 | + if ( isset( $this->cached_paths[$class_name] ) && file_exists( $this->cached_paths[$class_name] ) ) { |
|
58 | + include_once $this->cached_paths[$class_name]; |
|
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | foreach ( $paths as $path ) { |
65 | 65 | $path = wp_normalize_path( $path ); |
66 | 66 | if ( file_exists( $path ) ) { |
67 | - $this->cached_paths[ $class_name ] = $path; |
|
67 | + $this->cached_paths[$class_name] = $path; |
|
68 | 68 | include_once $path; |
69 | 69 | return; |
70 | 70 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | // Handle controls loading. |
101 | 101 | if ( 'Control' === $name_parts[0] || 'Settings' === $name_parts[0] ) { |
102 | - $path = dirname( __FILE__ ) . '/controls/php/'; |
|
102 | + $path = dirname( __FILE__ ) . '/controls/php/'; |
|
103 | 103 | |
104 | 104 | $paths[] = $path . $filename; |
105 | 105 | } |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | |
115 | 115 | $previous_path = ''; |
116 | 116 | for ( $i = 0; $i < $levels; $i++ ) { |
117 | - $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename; |
|
118 | - $previous_path .= strtolower( $exploded[ $i ] ) . '/'; |
|
117 | + $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename; |
|
118 | + $previous_path .= strtolower( $exploded[$i] ) . '/'; |
|
119 | 119 | } |
120 | 120 | return $paths; |
121 | 121 | } |
@@ -147,15 +147,15 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | foreach ( array_keys( $this->json['value'] ) as $key ) { |
150 | - if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][ $key ] ) ) { |
|
151 | - unset( $this->json['value'][ $key ] ); |
|
150 | + if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][$key] ) ) { |
|
151 | + unset( $this->json['value'][$key] ); |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | 155 | // Fix for https://github.com/aristath/kirki/issues/1405. |
156 | 156 | foreach ( array_keys( $this->json['value'] ) as $key ) { |
157 | - if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) { |
|
158 | - unset( $this->json['value'][ $key ] ); |
|
157 | + if ( isset( $this->json['default'][$key] ) && false === $this->json['default'][$key] ) { |
|
158 | + unset( $this->json['value'][$key] ); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | $this->json['show_variants'] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | if ( is_string( $variant ) ) { |
339 | 339 | $final_variants[] = array( |
340 | 340 | 'id' => $variant, |
341 | - 'label' => isset( $all_variants[ $variant ] ) ? $all_variants[ $variant ] : $variant, |
|
341 | + 'label' => isset( $all_variants[$variant] ) ? $all_variants[$variant] : $variant, |
|
342 | 342 | ); |
343 | 343 | } elseif ( is_array( $variant ) && isset( $variant['id'] ) && isset( $variant['label'] ) ) { |
344 | 344 | $final_variants[] = $variant; |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | if ( array_key_exists( $variant, $all_variants ) ) { |
420 | 420 | $available_variants[] = array( |
421 | 421 | 'id' => $variant, |
422 | - 'label' => $all_variants[ $variant ], |
|
422 | + 'label' => $all_variants[$variant], |
|
423 | 423 | ); |
424 | 424 | } |
425 | 425 | } |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | if ( array_key_exists( $subset, $all_subsets ) ) { |
432 | 432 | $available_subsets[] = array( |
433 | 433 | 'id' => $subset, |
434 | - 'label' => $all_subsets[ $subset ], |
|
434 | + 'label' => $all_subsets[$subset], |
|
435 | 435 | ); |
436 | 436 | } |
437 | 437 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; |
48 | 48 | |
49 | 49 | // Create the styles. |
50 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value . $output['suffix']; |
|
50 | + $this->styles[$output['media_query']][$output['element']][$property] = $sub_value . $output['suffix']; |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | } |
@@ -93,7 +93,7 @@ |
||
93 | 93 | * Returns an array of paths where translation files may be located. |
94 | 94 | * |
95 | 95 | * @access protected |
96 | - * @return array |
|
96 | + * @return string[] |
|
97 | 97 | */ |
98 | 98 | protected function get_paths() { |
99 | 99 |
@@ -117,9 +117,9 @@ |
||
117 | 117 | public function override_load_textdomain( $override, $domain, $mofile ) { |
118 | 118 | |
119 | 119 | global $l10n; |
120 | - if ( isset( $l10n[ $this->get_theme_textdomain() ] ) ) { |
|
120 | + if ( isset( $l10n[$this->get_theme_textdomain()] ) ) { |
|
121 | 121 | // @codingStandardsIgnoreLine WordPress.Variables.GlobalVariables.OverrideProhibited |
122 | - $l10n['kirki'] = $l10n[ $this->get_theme_textdomain() ]; |
|
122 | + $l10n['kirki'] = $l10n[$this->get_theme_textdomain()]; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | // Check if the domain is "kirki". |