@@ -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 | $paths[] = $path . $filename; |
104 | 104 | } |
105 | 105 | } |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | |
114 | 114 | $previous_path = ''; |
115 | 115 | for ( $i = 0; $i < $levels; $i++ ) { |
116 | - $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename; |
|
117 | - $previous_path .= strtolower( $exploded[ $i ] ) . '/'; |
|
116 | + $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename; |
|
117 | + $previous_path .= strtolower( $exploded[$i] ) . '/'; |
|
118 | 118 | } |
119 | 119 | return $paths; |
120 | 120 | } |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | parent::to_json(); |
52 | 52 | |
53 | 53 | foreach ( array_keys( $this->json['value'] ) as $key ) { |
54 | - if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ) ) && ! isset( $this->json['default'][ $key ] ) ) { |
|
55 | - unset( $this->json['value'][ $key ] ); |
|
54 | + if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ) ) && ! isset( $this->json['default'][$key] ) ) { |
|
55 | + unset( $this->json['value'][$key] ); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | // Fix for https://github.com/aristath/kirki/issues/1405. |
60 | 60 | foreach ( array_keys( $this->json['value'] ) as $key ) { |
61 | - if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) { |
|
62 | - unset( $this->json['value'][ $key ] ); |
|
61 | + if ( isset( $this->json['default'][$key] ) && false === $this->json['default'][$key] ) { |
|
62 | + unset( $this->json['value'][$key] ); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | $this->json['show_variants'] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if ( is_string( $variant ) ) { |
258 | 258 | $final_variants[] = array( |
259 | 259 | 'id' => $variant, |
260 | - 'label' => isset( $all_variants[ $variant ] ) ? $all_variants[ $variant ] : $variant, |
|
260 | + 'label' => isset( $all_variants[$variant] ) ? $all_variants[$variant] : $variant, |
|
261 | 261 | ); |
262 | 262 | } elseif ( is_array( $variant ) && isset( $variant['id'] ) && isset( $variant['label'] ) ) { |
263 | 263 | $final_variants[] = $variant; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | if ( array_key_exists( $variant, $all_variants ) ) { |
339 | 339 | $available_variants[] = array( |
340 | 340 | 'id' => $variant, |
341 | - 'label' => $all_variants[ $variant ], |
|
341 | + 'label' => $all_variants[$variant], |
|
342 | 342 | ); |
343 | 343 | } |
344 | 344 | } |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | if ( array_key_exists( $subset, $all_subsets ) ) { |
351 | 351 | $available_subsets[] = array( |
352 | 352 | 'id' => $subset, |
353 | - 'label' => $all_subsets[ $subset ], |
|
353 | + 'label' => $all_subsets[$subset], |
|
354 | 354 | ); |
355 | 355 | } |
356 | 356 | } |