Test Setup Failed
Push — master ( 2bd82a...5ed5ac )
by Aristeides
03:55 queued 01:33
created
controls/php/class-kirki-control-color.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@
 block discarded – undo
53 53
 	public function to_json() {
54 54
 		parent::to_json();
55 55
 
56
-		$this->json['palette'] = $this->palette;
57
-		$this->json['choices']['alpha'] = ( isset( $this->choices['alpha'] ) && $this->choices['alpha'] ) ? 'true' : 'false';
58
-		$this->json['mode'] = $this->mode;
56
+		$this->json[ 'palette' ] = $this->palette;
57
+		$this->json[ 'choices' ][ 'alpha' ] = ( isset( $this->choices[ 'alpha' ] ) && $this->choices[ 'alpha' ] ) ? 'true' : 'false';
58
+		$this->json[ 'mode' ] = $this->mode;
59 59
 	}
60 60
 }
Please login to merge, or discard this patch.
controls/php/class-kirki-control-dashicons.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 	public function to_json() {
36 36
 		parent::to_json();
37 37
 
38
-		$this->json['icons'] = Kirki_Helper::get_dashicons();
38
+		$this->json[ 'icons' ] = Kirki_Helper::get_dashicons();
39 39
 	}
40 40
 
41 41
 	/**
Please login to merge, or discard this patch.
controls/php/class-kirki-control-radio-image.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@
 block discarded – undo
37 37
 
38 38
 		foreach ( $this->input_attrs as $attr => $value ) {
39 39
 			if ( 'style' !== $attr ) {
40
-				$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
40
+				$this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" ';
41 41
 				continue;
42 42
 			}
43
-			$this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" ';
43
+			$this->json[ 'labelStyle' ] = 'style="' . esc_attr( $value ) . '" ';
44 44
 		}
45 45
 
46 46
 	}
Please login to merge, or discard this patch.
controls/php/class-kirki-control-dimensions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@
 block discarded – undo
39 39
 		if ( is_array( $this->choices ) ) {
40 40
 			foreach ( $this->choices as $choice => $value ) {
41 41
 				if ( 'labels' !== $choice && true === $value ) {
42
-					$this->json['choices'][ $choice ] = true;
42
+					$this->json[ 'choices' ][ $choice ] = true;
43 43
 				}
44 44
 			}
45 45
 		}
46
-		if ( is_array( $this->json['default'] ) ) {
47
-			foreach ( $this->json['default'] as $key => $value ) {
48
-				if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) {
49
-					$this->json['value'][ $key ] = $value;
46
+		if ( is_array( $this->json[ 'default' ] ) ) {
47
+			foreach ( $this->json[ 'default' ] as $key => $value ) {
48
+				if ( isset( $this->json[ 'choices' ][ $key ] ) && ! isset( $this->json[ 'value' ][ $key ] ) ) {
49
+					$this->json[ 'value' ][ $key ] = $value;
50 50
 				}
51 51
 			}
52 52
 		}
Please login to merge, or discard this patch.
controls/php/class-kirki-control-select.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,6 +44,6 @@
 block discarded – undo
44 44
 	public function to_json() {
45 45
 		parent::to_json();
46 46
 
47
-		$this->json['multiple'] = $this->multiple;
47
+		$this->json[ 'multiple' ] = $this->multiple;
48 48
 	}
49 49
 }
Please login to merge, or discard this patch.
controls/php/class-kirki-control-base.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -128,30 +128,30 @@
 block discarded – undo
128 128
 		// Get the basics from the parent class.
129 129
 		parent::to_json();
130 130
 		// Default.
131
-		$this->json['default'] = $this->setting->default;
131
+		$this->json[ 'default' ] = $this->setting->default;
132 132
 		if ( isset( $this->default ) ) {
133
-			$this->json['default'] = $this->default;
133
+			$this->json[ 'default' ] = $this->default;
134 134
 		}
135 135
 		// Required.
136
-		$this->json['required'] = $this->required;
136
+		$this->json[ 'required' ] = $this->required;
137 137
 		// Output.
138
-		$this->json['output'] = $this->output;
138
+		$this->json[ 'output' ] = $this->output;
139 139
 		// Value.
140
-		$this->json['value'] = $this->value();
140
+		$this->json[ 'value' ] = $this->value();
141 141
 		// Choices.
142
-		$this->json['choices'] = $this->choices;
142
+		$this->json[ 'choices' ] = $this->choices;
143 143
 		// The link.
144
-		$this->json['link'] = $this->get_link();
144
+		$this->json[ 'link' ] = $this->get_link();
145 145
 		// The ID.
146
-		$this->json['id'] = $this->id;
146
+		$this->json[ 'id' ] = $this->id;
147 147
 		// Translation strings.
148
-		$this->json['l10n'] = $this->l10n();
148
+		$this->json[ 'l10n' ] = $this->l10n();
149 149
 		// The ajaxurl in case we need it.
150
-		$this->json['ajaxurl'] = admin_url( 'admin-ajax.php' );
150
+		$this->json[ 'ajaxurl' ] = admin_url( 'admin-ajax.php' );
151 151
 		// Input attributes.
152
-		$this->json['inputAttrs'] = '';
152
+		$this->json[ 'inputAttrs' ] = '';
153 153
 		foreach ( $this->input_attrs as $attr => $value ) {
154
-			$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
154
+			$this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" ';
155 155
 		}
156 156
 	}
157 157
 
Please login to merge, or discard this patch.
controls/php/class-kirki-control-multicolor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	public function to_json() {
44 44
 		parent::to_json();
45 45
 
46
-		$this->json['alpha'] = (bool) $this->alpha;
46
+		$this->json[ 'alpha' ] = (bool) $this->alpha;
47 47
 	}
48 48
 
49 49
 	/**
Please login to merge, or discard this patch.
controls/php/class-kirki-control-slider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 	public function to_json() {
38 38
 		parent::to_json();
39 39
 
40
-		$this->json['choices'] = wp_parse_args( $this->json['choices'], array(
40
+		$this->json[ 'choices' ] = wp_parse_args( $this->json[ 'choices' ], array(
41 41
 			'min'    => '0',
42 42
 			'max'    => '100',
43 43
 			'step'   => '1',
Please login to merge, or discard this patch.
controls/php/class-kirki-control-repeater.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -76,28 +76,28 @@  discard block
 block discarded – undo
76 76
 
77 77
 		if ( empty( $this->button_label ) ) {
78 78
 			/* translators: %s represents the label of the row. */
79
-			$this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label['value'] );
79
+			$this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label[ 'value' ] );
80 80
 		}
81 81
 
82
-		if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) {
83
-			$args['fields'] = array();
82
+		if ( empty( $args[ 'fields' ] ) || ! is_array( $args[ 'fields' ] ) ) {
83
+			$args[ 'fields' ] = array();
84 84
 		}
85 85
 
86 86
 		// An array to store keys of fields that need to be filtered.
87 87
 		$media_fields_to_filter = array();
88 88
 
89
-		foreach ( $args['fields'] as $key => $value ) {
90
-			if ( ! isset( $value['default'] ) ) {
91
-				$args['fields'][ $key ]['default'] = '';
89
+		foreach ( $args[ 'fields' ] as $key => $value ) {
90
+			if ( ! isset( $value[ 'default' ] ) ) {
91
+				$args[ 'fields' ][ $key ][ 'default' ] = '';
92 92
 			}
93
-			if ( ! isset( $value['label'] ) ) {
94
-				$args['fields'][ $key ]['label'] = '';
93
+			if ( ! isset( $value[ 'label' ] ) ) {
94
+				$args[ 'fields' ][ $key ][ 'label' ] = '';
95 95
 			}
96
-			$args['fields'][ $key ]['id']      = $key;
96
+			$args[ 'fields' ][ $key ][ 'id' ] = $key;
97 97
 
98 98
 			// We check if the filed is an uploaded media ( image , file, video, etc.. ).
99
-			if ( isset( $value['type'] ) ) {
100
-				switch ( $value['type'] ) {
99
+			if ( isset( $value[ 'type' ] ) ) {
100
+				switch ( $value[ 'type' ] ) {
101 101
 					case 'image':
102 102
 					case 'cropped_image':
103 103
 					case 'upload':
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 							)
118 118
 						);
119 119
 						// Hackily add in the data link parameter.
120
-						$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args['fields'][ $key ]['id'] ) . '"' . $this->get_link(), $dropdown );
121
-						$args['fields'][ $key ]['dropdown'] = $dropdown;
120
+						$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args[ 'fields' ][ $key ][ 'id' ] ) . '"' . $this->get_link(), $dropdown );
121
+						$args[ 'fields' ][ $key ][ 'dropdown' ] = $dropdown;
122 122
 						break;
123 123
 				}
124 124
 			}
125 125
 		} // End foreach().
126 126
 
127
-		$this->fields = $args['fields'];
127
+		$this->fields = $args[ 'fields' ];
128 128
 
129 129
 		// Now we are going to filter the fields.
130 130
 		// First we create a copy of the value that would be used otherwise.
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 
185 185
 		$fields = $this->fields;
186 186
 
187
-		$this->json['fields'] = $fields;
188
-		$this->json['row_label'] = $this->row_label;
187
+		$this->json[ 'fields' ] = $fields;
188
+		$this->json[ 'row_label' ] = $this->row_label;
189 189
 
190 190
 		// If filtered_value has been set and is not empty we use it instead of the actual value.
191 191
 		if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) {
192
-			$this->json['value'] = $this->filtered_value;
192
+			$this->json[ 'value' ] = $this->filtered_value;
193 193
 		}
194
-		$this->json['value'] = apply_filters( "kirki/controls/repeater/value/{$this->id}", $this->json['value'] );
194
+		$this->json[ 'value' ] = apply_filters( "kirki/controls/repeater/value/{$this->id}", $this->json[ 'value' ] );
195 195
 	}
196 196
 
197 197
 	/**
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 		<ul class="repeater-fields"></ul>
216 216
 
217
-		<?php if ( isset( $this->choices['limit'] ) ) : ?>
217
+		<?php if ( isset( $this->choices[ 'limit' ] ) ) : ?>
218 218
 			<?php // @codingStandardsIgnoreLine ?>
219 219
 			<?php /* translators: %s represents the number of rows we're limiting the repeater to allow. */ ?>
220
-			<p class="limit"><?php printf( esc_attr__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices['limit'] ) ); ?></p>
220
+			<p class="limit"><?php printf( esc_attr__( 'Limit: %s rows', 'kirki' ), esc_html( $this->choices[ 'limit' ] ) ); ?></p>
221 221
 		<?php endif; ?>
222 222
 		<button class="button-secondary repeater-add"><?php echo esc_html( $this->button_label ); ?></button>
223 223
 
@@ -447,24 +447,24 @@  discard block
 block discarded – undo
447 447
 	protected function row_label( $args ) {
448 448
 
449 449
 		// Validating args for row labels.
450
-		if ( isset( $args['row_label'] ) && is_array( $args['row_label'] ) && ! empty( $args['row_label'] ) ) {
450
+		if ( isset( $args[ 'row_label' ] ) && is_array( $args[ 'row_label' ] ) && ! empty( $args[ 'row_label' ] ) ) {
451 451
 
452 452
 			// Validating row label type.
453
-			if ( isset( $args['row_label']['type'] ) && ( 'text' === $args['row_label']['type'] || 'field' === $args['row_label']['type'] ) ) {
454
-				$this->row_label['type'] = $args['row_label']['type'];
453
+			if ( isset( $args[ 'row_label' ][ 'type' ] ) && ( 'text' === $args[ 'row_label' ][ 'type' ] || 'field' === $args[ 'row_label' ][ 'type' ] ) ) {
454
+				$this->row_label[ 'type' ] = $args[ 'row_label' ][ 'type' ];
455 455
 			}
456 456
 
457 457
 			// Validating row label type.
458
-			if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) {
459
-				$this->row_label['value'] = esc_attr( $args['row_label']['value'] );
458
+			if ( isset( $args[ 'row_label' ][ 'value' ] ) && ! empty( $args[ 'row_label' ][ 'value' ] ) ) {
459
+				$this->row_label[ 'value' ] = esc_attr( $args[ 'row_label' ][ 'value' ] );
460 460
 			}
461 461
 
462 462
 			// Validating row label field.
463
-			if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) {
464
-				$this->row_label['field'] = esc_attr( $args['row_label']['field'] );
463
+			if ( isset( $args[ 'row_label' ][ 'field' ] ) && ! empty( $args[ 'row_label' ][ 'field' ] ) && isset( $args[ 'fields' ][ esc_attr( $args[ 'row_label' ][ 'field' ] ) ] ) ) {
464
+				$this->row_label[ 'field' ] = esc_attr( $args[ 'row_label' ][ 'field' ] );
465 465
 			} else {
466 466
 				// If from field is not set correctly, making sure standard is set as the type.
467
-				$this->row_label['type'] = 'text';
467
+				$this->row_label[ 'type' ] = 'text';
468 468
 			}
469 469
 		}
470 470
 	}
Please login to merge, or discard this patch.