Completed
Pull Request — develop (#2021)
by
unknown
04:23
created
modules/css-vars/class-kirki-modules-css-vars.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -79,16 +79,16 @@  discard block
 block discarded – undo
79 79
 		echo '<style id="kirki-css-vars">';
80 80
 		echo ':root{';
81 81
 		foreach ( $fields as $id => $args ) {
82
-			if ( ! isset( $args['css_vars'] ) || empty( $args['css_vars'] ) ) {
82
+			if ( ! isset( $args[ 'css_vars' ] ) || empty( $args[ 'css_vars' ] ) ) {
83 83
 				continue;
84 84
 			}
85
-			$val = Kirki_Values::get_value( $args['kirki_config'], $id );
85
+			$val = Kirki_Values::get_value( $args[ 'kirki_config' ], $id );
86 86
 			if ( ! empty( $val ) ) {
87
-				foreach ( $args['css_vars'] as $css_var ) {
88
-					if ( isset( $css_var[2] ) && is_array( $val ) && isset( $val[ $css_var[2] ] ) ) {
89
-						echo esc_html( $css_var[0] ) . ':' . esc_html( str_replace( '$', $val[ $css_var[2] ], $css_var[1] ) ) . ';';
87
+				foreach ( $args[ 'css_vars' ] as $css_var ) {
88
+					if ( isset( $css_var[ 2 ] ) && is_array( $val ) && isset( $val[ $css_var[ 2 ] ] ) ) {
89
+						echo esc_html( $css_var[ 0 ] ) . ':' . esc_html( str_replace( '$', $val[ $css_var[ 2 ] ], $css_var[ 1 ] ) ) . ';';
90 90
 					} else {
91
-						echo esc_html( $css_var[0] ) . ':' . esc_html( str_replace( '$', $val, $css_var[1] ) ) . ';';
91
+						echo esc_html( $css_var[ 0 ] ) . ':' . esc_html( str_replace( '$', $val, $css_var[ 1 ] ) ) . ';';
92 92
 					}
93 93
 				}
94 94
 			}
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 		$fields = Kirki::$fields;
112 112
 		$data   = array();
113 113
 		foreach ( $fields as $field ) {
114
-			if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_vars'] ) && ! empty( $field['css_vars'] ) ) {
115
-				$data[] = $field;
114
+			if ( isset( $field[ 'transport' ] ) && 'postMessage' === $field[ 'transport' ] && isset( $field[ 'css_vars' ] ) && ! empty( $field[ 'css_vars' ] ) ) {
115
+				$data[ ] = $field;
116 116
 			}
117 117
 		}
118 118
 		wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data );
Please login to merge, or discard this patch.