| @@ -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 | |
| @@ -64,8 +64,8 @@ discard block | ||
| 64 | 64 | } | 
| 65 | 65 | |
| 66 | 66 | // Check if we've got it cached and ready. | 
| 67 | -		if ( isset( $this->cached_paths[ $class_name ] ) && file_exists( $this->cached_paths[ $class_name ] ) ) { | |
| 68 | - include_once $this->cached_paths[ $class_name ]; | |
| 67 | +		if ( isset( $this->cached_paths[$class_name] ) && file_exists( $this->cached_paths[$class_name] ) ) { | |
| 68 | + include_once $this->cached_paths[$class_name]; | |
| 69 | 69 | return; | 
| 70 | 70 | } | 
| 71 | 71 | |
| @@ -74,7 +74,7 @@ discard block | ||
| 74 | 74 |  		foreach ( $paths as $path ) { | 
| 75 | 75 | $path = wp_normalize_path( $path ); | 
| 76 | 76 |  			if ( file_exists( $path ) ) { | 
| 77 | - $this->cached_paths[ $class_name ] = $path; | |
| 77 | + $this->cached_paths[$class_name] = $path; | |
| 78 | 78 | include_once $path; | 
| 79 | 79 | return; | 
| 80 | 80 | } | 
| @@ -134,8 +134,8 @@ discard block | ||
| 134 | 134 | |
| 135 | 135 | $previous_path = ''; | 
| 136 | 136 |  		for ( $i = 0; $i < $levels; $i++ ) { | 
| 137 | - $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename; | |
| 138 | - $previous_path .= strtolower( $exploded[ $i ] ) . '/'; | |
| 137 | + $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[$i] ) . '/' . $filename; | |
| 138 | + $previous_path .= strtolower( $exploded[$i] ) . '/'; | |
| 139 | 139 | } | 
| 140 | 140 | return $paths; | 
| 141 | 141 | } | 
| @@ -130,8 +130,8 @@ | ||
| 130 | 130 | // Are we force-loading all subsets? | 
| 131 | 131 |  		if ( true === Kirki_Fonts_Google::$force_load_all_subsets ) { | 
| 132 | 132 | |
| 133 | -			if ( isset( $this->googlefonts->fonts[ $font ]['subsets'] ) ) { | |
| 134 | -				foreach ( $this->googlefonts->fonts[ $font ]['subsets'] as $subset ) { | |
| 133 | +			if ( isset( $this->googlefonts->fonts[$font]['subsets'] ) ) { | |
| 134 | +				foreach ( $this->googlefonts->fonts[$font]['subsets'] as $subset ) { | |
| 135 | 135 | $this->subsets[] = $subset; | 
| 136 | 136 | } | 
| 137 | 137 | } | 
| @@ -142,10 +142,10 @@ discard block | ||
| 142 | 142 | $js_var['index_key'] = $key; | 
| 143 | 143 | $callback = $this->get_callback( $args ); | 
| 144 | 144 |  			if ( is_callable( $callback ) ) { | 
| 145 | - $field['scripts'][ $key ] = call_user_func_array( $callback, array( $js_var, $args ) ); | |
| 145 | + $field['scripts'][$key] = call_user_func_array( $callback, array( $js_var, $args ) ); | |
| 146 | 146 | continue; | 
| 147 | 147 | } | 
| 148 | - $field['scripts'][ $key ] = $this->script_var( $js_var ); | |
| 148 | + $field['scripts'][$key] = $this->script_var( $js_var ); | |
| 149 | 149 | } | 
| 150 | 150 | $combo_extra_script = ''; | 
| 151 | 151 | $combo_css_script = ''; | 
| @@ -177,7 +177,7 @@ discard block | ||
| 177 | 177 | */ | 
| 178 | 178 |  	protected function script_html_var( $args ) { | 
| 179 | 179 | |
| 180 | -		$script  = ( isset( $args['choice'] ) ) ? "newval=newval['{$args['choice']}'];" : ''; | |
| 180 | +		$script = ( isset( $args['choice'] ) ) ? "newval=newval['{$args['choice']}'];" : ''; | |
| 181 | 181 | |
| 182 | 182 | // Apply the value_pattern. | 
| 183 | 183 |  		if ( isset( $args['value_pattern'] ) && '' !== $args['value_pattern'] ) { | 
| @@ -251,7 +251,7 @@ discard block | ||
| 251 | 251 | $property_script = ''; | 
| 252 | 252 | |
| 253 | 253 | // Define choice. | 
| 254 | - $choice = ( isset( $args['choice'] ) && '' !== $args['choice'] ) ? $args['choice'] : ''; | |
| 254 | + $choice = ( isset( $args['choice'] ) && '' !== $args['choice'] ) ? $args['choice'] : ''; | |
| 255 | 255 | |
| 256 | 256 | $value_key = 'newval' . $args['index_key']; | 
| 257 | 257 | $property_script .= $value_key . '=newval;'; | 
| @@ -342,7 +342,7 @@ discard block | ||
| 342 | 342 | 'font-weight' => 'fontWeight', | 
| 343 | 343 | 'font-style' => 'fontStyle', | 
| 344 | 344 | ); | 
| 345 | - $choice_condition = ( isset( $args['choice'] ) && '' !== $args['choice'] && isset( $css_build_array[ $args['choice'] ] ) ); | |
| 345 | + $choice_condition = ( isset( $args['choice'] ) && '' !== $args['choice'] && isset( $css_build_array[$args['choice']] ) ); | |
| 346 | 346 | $script .= ( ! $choice_condition ) ? $webfont_loader : ''; | 
| 347 | 347 |  		foreach ( $css_build_array as $property => $var ) { | 
| 348 | 348 |  			if ( $choice_condition && $property !== $args['choice'] ) { | 
| @@ -453,7 +453,7 @@ discard block | ||
| 453 | 453 | 'units' => '', | 
| 454 | 454 | 'js_callback' => array( '', '' ), | 
| 455 | 455 | 'value_pattern' => '', | 
| 456 | - )); | |
| 456 | + ) ); | |
| 457 | 457 | |
| 458 | 458 | // Element should be a string. | 
| 459 | 459 |  		if ( is_array( $args['element'] ) ) { | 
| @@ -114,7 +114,7 @@ discard block | ||
| 114 | 114 | |
| 115 | 115 | $config = Kirki_Config::get_instance( $config_id, $args ); | 
| 116 | 116 | $config_args = $config->get_config(); | 
| 117 | - self::$config[ $config_args['id'] ] = $config_args; | |
| 117 | + self::$config[$config_args['id']] = $config_args; | |
| 118 | 118 | } | 
| 119 | 119 | |
| 120 | 120 | /** | 
| @@ -136,7 +136,7 @@ discard block | ||
| 136 | 136 | $args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true'; | 
| 137 | 137 | } | 
| 138 | 138 | |
| 139 | - self::$panels[ $args['id'] ] = $args; | |
| 139 | + self::$panels[$args['id']] = $args; | |
| 140 | 140 | } | 
| 141 | 141 | |
| 142 | 142 | /** | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | $args['active_callback'] = ( isset( $args['required'] ) ) ? array( 'Kirki_Active_Callback', 'evaluate' ) : '__return_true'; | 
| 160 | 160 | } | 
| 161 | 161 | |
| 162 | - self::$sections[ $args['id'] ] = $args; | |
| 162 | + self::$sections[$args['id']] = $args; | |
| 163 | 163 | } | 
| 164 | 164 | |
| 165 | 165 | /** | 
| @@ -208,9 +208,9 @@ discard block | ||
| 208 | 208 | */ | 
| 209 | 209 |  	public static function get_config_param( $id, $param ) { | 
| 210 | 210 | |
| 211 | -		if ( ! isset( self::$config[ $id ] ) || ! isset( self::$config[ $id ][ $param ] ) ) { | |
| 211 | +		if ( ! isset( self::$config[$id] ) || ! isset( self::$config[$id][$param] ) ) { | |
| 212 | 212 | return ''; | 
| 213 | 213 | } | 
| 214 | - return self::$config[ $id ][ $param ]; | |
| 214 | + return self::$config[$id][$param]; | |
| 215 | 215 | } | 
| 216 | 216 | } | 
| @@ -257,13 +257,13 @@ discard block | ||
| 257 | 257 | |
| 258 | 258 | // Get the config arguments, and merge them with the defaults. | 
| 259 | 259 | $config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array(); | 
| 260 | -		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) { | |
| 261 | - $config_defaults = Kirki::$config[ $this->kirki_config ]; | |
| 260 | +		if ( 'global' !== $this->kirki_config && isset( Kirki::$config[$this->kirki_config] ) ) { | |
| 261 | + $config_defaults = Kirki::$config[$this->kirki_config]; | |
| 262 | 262 | } | 
| 263 | 263 | $config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array(); | 
| 264 | 264 |  		foreach ( $config_defaults as $key => $value ) { | 
| 265 | -			if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value !== $defaults[ $key ] ) { | |
| 266 | - $defaults[ $key ] = $value; | |
| 265 | +			if ( isset( $defaults[$key] ) && ! empty( $value ) && $value !== $defaults[$key] ) { | |
| 266 | + $defaults[$key] = $value; | |
| 267 | 267 | } | 
| 268 | 268 | } | 
| 269 | 269 | |
| @@ -308,11 +308,11 @@ discard block | ||
| 308 | 308 | // Get all arguments with their values. | 
| 309 | 309 | $args = get_object_vars( $this ); | 
| 310 | 310 |  		foreach ( array_keys( $args ) as $key ) { | 
| 311 | - $args[ $key ] = $this->$key; | |
| 311 | + $args[$key] = $this->$key; | |
| 312 | 312 | } | 
| 313 | 313 | |
| 314 | 314 | // Add the field to the static $fields variable properly indexed. | 
| 315 | - Kirki::$fields[ $this->settings ] = $args; | |
| 315 | + Kirki::$fields[$this->settings] = $args; | |
| 316 | 316 | |
| 317 | 317 | } | 
| 318 | 318 | |
| @@ -407,7 +407,7 @@ discard block | ||
| 407 | 407 |  			if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) { | 
| 408 | 408 | /* translators: %1$s represents the field ID where the error occurs. */ | 
| 409 | 409 | _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' ); | 
| 410 | - unset( $this->partial_refresh[ $id ] ); | |
| 410 | + unset( $this->partial_refresh[$id] ); | |
| 411 | 411 | continue; | 
| 412 | 412 | } | 
| 413 | 413 | } | 
| @@ -435,10 +435,10 @@ discard block | ||
| 435 | 435 | } | 
| 436 | 436 | $settings = array(); | 
| 437 | 437 |  		foreach ( $this->settings as $setting_key => $setting_value ) { | 
| 438 | - $settings[ $setting_key ] = $setting_value; | |
| 438 | + $settings[$setting_key] = $setting_value; | |
| 439 | 439 | // If we're using serialized options then we need to spice this up. | 
| 440 | 440 |  			if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) { | 
| 441 | -				$settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]"; | |
| 441 | +				$settings[$setting_key] = "{$this->option_name}[{$setting_value}]"; | |
| 442 | 442 | } | 
| 443 | 443 | } | 
| 444 | 444 | $this->settings = $settings; | 
| @@ -563,17 +563,17 @@ discard block | ||
| 563 | 563 | } | 
| 564 | 564 |  		foreach ( $this->output as $key => $output ) { | 
| 565 | 565 |  			if ( empty( $output ) || ! isset( $output['element'] ) ) { | 
| 566 | - unset( $this->output[ $key ] ); | |
| 566 | + unset( $this->output[$key] ); | |
| 567 | 567 | continue; | 
| 568 | 568 | } | 
| 569 | 569 |  			if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) { | 
| 570 | - $this->output[ $key ]['sanitize_callback'] = $output['callback']; | |
| 570 | + $this->output[$key]['sanitize_callback'] = $output['callback']; | |
| 571 | 571 | } | 
| 572 | 572 | // Convert element arrays to strings. | 
| 573 | 573 |  			if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { | 
| 574 | - $this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] ); | |
| 575 | - sort( $this->output[ $key ]['element'] ); | |
| 576 | - $this->output[ $key ]['element'] = implode( ',', $this->output[ $key ]['element'] ); | |
| 574 | + $this->output[$key]['element'] = array_unique( $this->output[$key]['element'] ); | |
| 575 | + sort( $this->output[$key]['element'] ); | |
| 576 | + $this->output[$key]['element'] = implode( ',', $this->output[$key]['element'] ); | |
| 577 | 577 | } | 
| 578 | 578 | } | 
| 579 | 579 | } | 
| @@ -71,7 +71,7 @@ discard block | ||
| 71 | 71 |  		if ( ! isset( $config['color_accent'] ) && ! isset( $config['color_back'] ) ) { | 
| 72 | 72 | return; | 
| 73 | 73 | } | 
| 74 | - $back = isset( $config['color_back'] ) ? $config['color_back'] : false; | |
| 74 | + $back = isset( $config['color_back'] ) ? $config['color_back'] : false; | |
| 75 | 75 | |
| 76 | 76 | $text_on_back = ''; | 
| 77 | 77 | $border_on_back = ''; | 
| @@ -93,7 +93,7 @@ discard block | ||
| 93 | 93 | $hover_on_back = ( 90 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 3 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 3 )->toCSS( $back_obj->mode ); | 
| 94 | 94 | $arrows_on_back = ( 50 > $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness + 30 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness - 30 )->toCSS( $back_obj->mode ); | 
| 95 | 95 | } | 
| 96 | - $accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false; | |
| 96 | + $accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false; | |
| 97 | 97 |  		if ( $accent ) { | 
| 98 | 98 | $accent_obj = ariColor::newColor( $accent ); | 
| 99 | 99 | $text_on_accent = ( 60 > $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness + 60 )->toCSS( $accent_obj->mode ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness - 60 )->toCSS( $accent_obj->mode ); | 
| @@ -34,8 +34,8 @@ | ||
| 34 | 34 | ); | 
| 35 | 35 | |
| 36 | 36 |  		foreach ( array( 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ) as $property ) { | 
| 37 | -			if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) { | |
| 38 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix']; | |
| 37 | +			if ( isset( $value[$property] ) && ! empty( $value[$property] ) ) { | |
| 38 | + $this->styles[$output['media_query']][$output['element']][$property] = $output['prefix'] . $this->process_property_value( $property, $value[$property] ) . $output['suffix']; | |
| 39 | 39 | } | 
| 40 | 40 | } | 
| 41 | 41 | } | 
| @@ -44,14 +44,14 @@ discard block | ||
| 44 | 44 | ); | 
| 45 | 45 | |
| 46 | 46 |  		foreach ( $properties as $property ) { | 
| 47 | -			if ( ! isset( $value[ $property ] ) || ! $value[ $property ] ) { | |
| 47 | +			if ( ! isset( $value[$property] ) || ! $value[$property] ) { | |
| 48 | 48 | continue; | 
| 49 | 49 | } | 
| 50 | 50 |  			if ( isset( $output['choice'] ) && $output['choice'] !== $property ) { | 
| 51 | 51 | continue; | 
| 52 | 52 | } | 
| 53 | 53 | |
| 54 | - $property_value = $this->process_property_value( $property, $value[ $property ] ); | |
| 54 | + $property_value = $this->process_property_value( $property, $value[$property] ); | |
| 55 | 55 |  			if ( 'font-family' === $property ) { | 
| 56 | 56 | $value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : ''; | 
| 57 | 57 | $property_value = $this->process_property_value( $property, array( | 
| @@ -61,7 +61,7 @@ discard block | ||
| 61 | 61 | } | 
| 62 | 62 | $property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property; | 
| 63 | 63 | $property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value; | 
| 64 | - $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix']; | |
| 64 | + $this->styles[$output['media_query']][$output['element']][$property] = $output['prefix'] . $property_value . $output['suffix']; | |
| 65 | 65 | } | 
| 66 | 66 | } | 
| 67 | 67 | } |