Completed
Pull Request — master (#1728)
by Aristeides
04:11 queued 02:08
created
modules/tooltips/class-kirki-modules-tooltips.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,13 +76,13 @@
 block discarded – undo
76 76
 
77 77
 		$fields = Kirki::$fields;
78 78
 		foreach ( $fields as $field ) {
79
-			if ( isset( $field['tooltip'] ) && ! empty( $field['tooltip'] ) ) {
79
+			if ( isset( $field[ 'tooltip' ] ) && ! empty( $field[ 'tooltip' ] ) ) {
80 80
 				// Get the control ID and properly format it for the tooltips
81
-				$id = str_replace( '[', '-', str_replace( ']', '', $field['settings'] ) );
81
+				$id = str_replace( '[', '-', str_replace( ']', '', $field[ 'settings' ] ) );
82 82
 				// Add the tooltips content.
83 83
 				$this->tooltips_content[ $id ] = array(
84 84
 					'id'      => $id,
85
-					'content' => wp_kses_post( $field['tooltip'] ),
85
+					'content' => wp_kses_post( $field[ 'tooltip' ] ),
86 86
 				);
87 87
 			}
88 88
 		}
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 ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
121
-						$args['fields'][ $key ]['dropdown'] = $dropdown;
120
+						$dropdown = str_replace( '<select', '<select data-field="' . esc_attr( $args[ 'fields' ][ $key ][ 'id' ] ) . '"' . $this->get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
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.
deprecated/filters.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	$config_ids = Kirki_Config::get_config_ids();
54 54
 	global $kirki_deprecated_filters_iteration;
55 55
 	foreach ( $config_ids as $config_id ) {
56
-		foreach( array(
56
+		foreach ( array(
57 57
 			'/dynamic_css',
58 58
 			'/output/control-classnames',
59 59
 			'/css/skip_hidden',
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 			$kirki_deprecated_filters_iteration = array( $config_id, $filter_suffix );
65 65
 			add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) {
66 66
 				global $kirki_deprecated_filters_iteration;
67
-				$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
68
-				return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args );
67
+				$kirki_deprecated_filters_iteration[ 1 ] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[ 1 ] );
68
+				return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[ 0 ]}/{$kirki_deprecated_filters_iteration[ 1 ]}", $args );
69 69
 			}, 99 );
70
-			if ( false !== strpos( $kirki_deprecated_filters_iteration[1], '-' ) ) {
71
-				$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
70
+			if ( false !== strpos( $kirki_deprecated_filters_iteration[ 1 ], '-' ) ) {
71
+				$kirki_deprecated_filters_iteration[ 1 ] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[ 1 ] );
72 72
 				add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) {
73 73
 					global $kirki_deprecated_filters_iteration;
74
-					$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
75
-					return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args );
74
+					$kirki_deprecated_filters_iteration[ 1 ] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[ 1 ] );
75
+					return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[ 0 ]}/{$kirki_deprecated_filters_iteration[ 1 ]}", $args );
76 76
 				}, 99 );
77 77
 			}
78 78
 		}
Please login to merge, or discard this patch.
Braces   +48 added lines, -24 removed lines patch added patch discarded remove patch
@@ -1,55 +1,68 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 // @codingStandardsIgnoreFile
3 3
 
4
-add_filter( 'kirki_config', function( $args ) {
4
+add_filter( 'kirki_config', function( $args )
5
+{
5 6
 	return apply_filters( 'kirki/config', $args );
6 7
 }, 99 );
7 8
 
8
-add_filter( 'kirki_control_types', function( $args ) {
9
+add_filter( 'kirki_control_types', function( $args )
10
+{
9 11
 	return apply_filters( 'kirki/control_types', $args );
10 12
 }, 99 );
11 13
 
12
-add_filter( 'kirki_section_types', function( $args ) {
14
+add_filter( 'kirki_section_types', function( $args )
15
+{
13 16
 	return apply_filters( 'kirki/section_types', $args );
14 17
 }, 99 );
15 18
 
16
-add_filter( 'kirki_section_types_exclude', function( $args ) {
19
+add_filter( 'kirki_section_types_exclude', function( $args )
20
+{
17 21
 	return apply_filters( 'kirki/section_types/exclude', $args );
18 22
 }, 99 );
19 23
 
20
-add_filter( 'kirki_control_types_exclude', function( $args ) {
24
+add_filter( 'kirki_control_types_exclude', function( $args )
25
+{
21 26
 	return apply_filters( 'kirki/control_types/exclude', $args );
22 27
 }, 99 );
23 28
 
24
-add_filter( 'kirki_controls', function( $args ) {
29
+add_filter( 'kirki_controls', function( $args )
30
+{
25 31
 	return apply_filters( 'kirki/controls', $args );
26 32
 }, 99 );
27 33
 
28
-add_filter( 'kirki_fields', function( $args ) {
34
+add_filter( 'kirki_fields', function( $args )
35
+{
29 36
 	return apply_filters( 'kirki/fields', $args );
30 37
 }, 99 );
31 38
 
32
-add_filter( 'kirki_modules', function( $args ) {
39
+add_filter( 'kirki_modules', function( $args )
40
+{
33 41
 	return apply_filters( 'kirki/modules', $args );
34 42
 }, 99 );
35 43
 
36
-add_filter( 'kirki_panel_types', function( $args ) {
44
+add_filter( 'kirki_panel_types', function( $args )
45
+{
37 46
 	return apply_filters( 'kirki/panel_types', $args );
38 47
 }, 99 );
39 48
 
40
-add_filter( 'kirki_setting_types', function( $args ) {
49
+add_filter( 'kirki_setting_types', function( $args )
50
+{
41 51
 	return apply_filters( 'kirki/setting_types', $args );
42 52
 }, 99 );
43 53
 
44
-add_filter( 'kirki_variable', function( $args ) {
54
+add_filter( 'kirki_variable', function( $args )
55
+{
45 56
 	return apply_filters( 'kirki/variable', $args );
46 57
 }, 99 );
47 58
 
48
-add_filter( 'kirki_values_get_value', function( $arg1, $arg2 ) {
59
+add_filter( 'kirki_values_get_value', function( $arg1, $arg2 )
60
+{
49 61
 	return apply_filters( 'kirki/values/get_value', $arg1, $arg2 );
50 62
 }, 99, 2 );
51 63
 
52
-add_action( 'init', function() {
64
+add_action( 'init', function()
65
+{
53 66
 	$config_ids = Kirki_Config::get_config_ids();
54 67
 	global $kirki_deprecated_filters_iteration;
55 68
 	foreach ( $config_ids as $config_id ) {
@@ -62,14 +75,16 @@  discard block
 block discarded – undo
62 75
 			'/webfonts/skip_hidden',
63 76
 		) as $filter_suffix ) {
64 77
 			$kirki_deprecated_filters_iteration = array( $config_id, $filter_suffix );
65
-			add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) {
78
+			add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args )
79
+			{
66 80
 				global $kirki_deprecated_filters_iteration;
67 81
 				$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
68 82
 				return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args );
69 83
 			}, 99 );
70 84
 			if ( false !== strpos( $kirki_deprecated_filters_iteration[1], '-' ) ) {
71 85
 				$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
72
-				add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args ) {
86
+				add_filter( "kirki_{$config_id}_{$filter_suffix}", function( $args )
87
+				{
73 88
 					global $kirki_deprecated_filters_iteration;
74 89
 					$kirki_deprecated_filters_iteration[1] = str_replace( '-', '_', $kirki_deprecated_filters_iteration[1] );
75 90
 					return apply_filters( "kirki/{$kirki_deprecated_filters_iteration[0]}/{$kirki_deprecated_filters_iteration[1]}", $args );
@@ -79,38 +94,47 @@  discard block
 block discarded – undo
79 94
 	}
80 95
 }, 99 );
81 96
 
82
-add_filter( 'kirki_enqueue_google_fonts', function( $args ) {
97
+add_filter( 'kirki_enqueue_google_fonts', function( $args )
98
+{
83 99
 	return apply_filters( 'kirki/enqueue_google_fonts', $args );
84 100
 }, 99 );
85 101
 
86
-add_filter( 'kirki_styles_array', function( $args ) {
102
+add_filter( 'kirki_styles_array', function( $args )
103
+{
87 104
 	return apply_filters( 'kirki/styles_array', $args );
88 105
 }, 99 );
89 106
 
90
-add_filter( 'kirki_dynamic_css_method', function( $args ) {
107
+add_filter( 'kirki_dynamic_css_method', function( $args )
108
+{
91 109
 	return apply_filters( 'kirki/dynamic_css/method', $args );
92 110
 }, 99 );
93 111
 
94
-add_filter( 'kirki_postmessage_script', function( $args ) {
112
+add_filter( 'kirki_postmessage_script', function( $args )
113
+{
95 114
 	return apply_filters( 'kirki/postmessage/script', $args );
96 115
 }, 99 );
97 116
 
98
-add_filter( 'kirki_fonts_all', function( $args ) {
117
+add_filter( 'kirki_fonts_all', function( $args )
118
+{
99 119
 	return apply_filters( 'kirki/fonts/all', $args );
100 120
 }, 99 );
101 121
 
102
-add_filter( 'kirki_fonts_standard_fonts', function( $args ) {
122
+add_filter( 'kirki_fonts_standard_fonts', function( $args )
123
+{
103 124
 	return apply_filters( 'kirki/fonts/standard_fonts', $args );
104 125
 }, 99 );
105 126
 
106
-add_filter( 'kirki_fonts_backup_fonts', function( $args ) {
127
+add_filter( 'kirki_fonts_backup_fonts', function( $args )
128
+{
107 129
 	return apply_filters( 'kirki/fonts/backup_fonts', $args );
108 130
 }, 99 );
109 131
 
110
-add_filter( 'kirki_fonts_google_fonts', function( $args ) {
132
+add_filter( 'kirki_fonts_google_fonts', function( $args )
133
+{
111 134
 	return apply_filters( 'kirki/fonts/google_fonts', $args );
112 135
 }, 99 );
113 136
 
114
-add_filter( 'kirki_googlefonts_load_method', function( $args ) {
137
+add_filter( 'kirki_googlefonts_load_method', function( $args )
138
+{
115 139
 	return apply_filters( 'kirki/googlefonts_load_method', $args );
116 140
 }, 99 );
Please login to merge, or discard this patch.
field/class-kirki-field-code.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
 	 * @access protected
60 60
 	 */
61 61
 	protected function set_choices() {
62
-		if ( ! isset( $this->choices['language'] ) ) {
62
+		if ( ! isset( $this->choices[ 'language' ] ) ) {
63 63
 			return;
64 64
 		}
65
-		$language = $this->choices['language'];
65
+		$language = $this->choices[ 'language' ];
66 66
 		switch ( $language ) {
67 67
 			case 'json':
68 68
 			case 'xml':
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 				$language = 'text/x-' . $language;
91 91
 				break;
92 92
 		}
93
-		if ( ! isset( $this->editor_settings['codemirror'] ) ) {
94
-			$this->editor_settings['codemirror'] = array();
93
+		if ( ! isset( $this->editor_settings[ 'codemirror' ] ) ) {
94
+			$this->editor_settings[ 'codemirror' ] = array();
95 95
 		}
96
-		if ( ! isset( $this->editor_settings['codemirror']['mode'] ) ) {
97
-			$this->editor_settings['codemirror']['mode'] = $language;
96
+		if ( ! isset( $this->editor_settings[ 'codemirror' ][ 'mode' ] ) ) {
97
+			$this->editor_settings[ 'codemirror' ][ 'mode' ] = $language;
98 98
 		}
99 99
 	}
100 100
 
Please login to merge, or discard this patch.
field/class-kirki-field-image.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 		if ( ! is_array( $this->choices ) ) {
61 61
 			$this->choices = (array) $this->choices;
62 62
 		}
63
-		if ( ! isset( $this->choices['save_as'] ) ) {
64
-			$this->choices['save_as'] = 'url';
63
+		if ( ! isset( $this->choices[ 'save_as' ] ) ) {
64
+			$this->choices[ 'save_as' ] = 'url';
65 65
 		}
66
-		if ( ! isset( $this->choices['labels'] ) ) {
67
-			$this->choices['labels'] = array();
66
+		if ( ! isset( $this->choices[ 'labels' ] ) ) {
67
+			$this->choices[ 'labels' ] = array();
68 68
 		}
69 69
 		$this->set_button_labels();
70
-		$this->choices['labels'] = wp_parse_args( $this->choices['labels'], $this->button_labels );
70
+		$this->choices[ 'labels' ] = wp_parse_args( $this->choices[ 'labels' ], $this->button_labels );
71 71
 	}
72 72
 
73 73
 	/**
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 	 */
94 94
 	public function sanitize( $value ) {
95 95
 
96
-		if ( isset( $this->choices['save_as'] ) && 'array' === $this->choices['save_as'] ) {
96
+		if ( isset( $this->choices[ 'save_as' ] ) && 'array' === $this->choices[ 'save_as' ] ) {
97 97
 			return array(
98
-				'id'     => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '',
99
-				'url'    => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '',
100
-				'width'  => ( isset( $value['width'] ) && '' !== $value['width'] ) ? (int) $value['width'] : '',
101
-				'height' => ( isset( $value['height'] ) && '' !== $value['height'] ) ? (int) $value['height'] : '',
98
+				'id'     => ( isset( $value[ 'id' ] ) && '' !== $value[ 'id' ] ) ? (int) $value[ 'id' ] : '',
99
+				'url'    => ( isset( $value[ 'url' ] ) && '' !== $value[ 'url' ] ) ? esc_url_raw( $value[ 'url' ] ) : '',
100
+				'width'  => ( isset( $value[ 'width' ] ) && '' !== $value[ 'width' ] ) ? (int) $value[ 'width' ] : '',
101
+				'height' => ( isset( $value[ 'height' ] ) && '' !== $value[ 'height' ] ) ? (int) $value[ 'height' ] : '',
102 102
 			);
103 103
 		}
104
-		if ( isset( $this->choices['save_as'] ) && 'id' === $this->choices['save_as'] ) {
104
+		if ( isset( $this->choices[ 'save_as' ] ) && 'id' === $this->choices[ 'save_as' ] ) {
105 105
 			return absint( $value );
106 106
 		}
107 107
 		if ( is_string( $value ) ) {
Please login to merge, or discard this patch.
controls/php/class-kirki-control-upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
 	 */
33 33
 	public function to_json() {
34 34
 		parent::to_json();
35
-		$this->json['required'] = $this->required;
35
+		$this->json[ 'required' ] = $this->required;
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
controls/php/class-kirki-control-cropped-image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
 	 */
33 33
 	public function to_json() {
34 34
 		parent::to_json();
35
-		$this->json['required'] = $this->required;
35
+		$this->json[ 'required' ] = $this->required;
36 36
 	}
37 37
 }
Please login to merge, or discard this patch.
core/class-kirki.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$config                             = Kirki_Config::get_instance( $config_id, $args );
146 146
 		$config_args                        = $config->get_config();
147
-		self::$config[ $config_args['id'] ] = $config_args;
147
+		self::$config[ $config_args[ 'id' ] ] = $config_args;
148 148
 	}
149 149
 
150 150
 	/**
@@ -157,13 +157,13 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public static function add_panel( $id = '', $args = array() ) {
159 159
 
160
-		$args['id']          = esc_attr( $id );
161
-		$args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : '';
162
-		$args['priority']    = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10;
163
-		$args['type']        = ( isset( $args['type'] ) ) ? $args['type'] : 'default';
164
-		$args['type']        = 'kirki-' . $args['type'];
160
+		$args[ 'id' ]          = esc_attr( $id );
161
+		$args[ 'description' ] = ( isset( $args[ 'description' ] ) ) ? $args[ 'description' ] : '';
162
+		$args[ 'priority' ]    = ( isset( $args[ 'priority' ] ) ) ? absint( $args[ 'priority' ] ) : 10;
163
+		$args[ 'type' ]        = ( isset( $args[ 'type' ] ) ) ? $args[ 'type' ] : 'default';
164
+		$args[ 'type' ]        = 'kirki-' . $args[ 'type' ];
165 165
 
166
-		self::$panels[ $args['id'] ] = $args;
166
+		self::$panels[ $args[ 'id' ] ] = $args;
167 167
 	}
168 168
 
169 169
 	/**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 	 */
177 177
 	public static function remove_panel( $id = '' ) {
178 178
 		if ( ! in_array( $id, self::$panels_to_remove, true ) ) {
179
-			self::$panels_to_remove[] = $id;
179
+			self::$panels_to_remove[ ] = $id;
180 180
 		}
181 181
 	}
182 182
 
@@ -190,14 +190,14 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	public static function add_section( $id, $args ) {
192 192
 
193
-		$args['id']          = esc_attr( $id );
194
-		$args['panel']       = ( isset( $args['panel'] ) ) ? esc_attr( $args['panel'] ) : '';
195
-		$args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : '';
196
-		$args['priority']    = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10;
197
-		$args['type']        = ( isset( $args['type'] ) ) ? $args['type'] : 'default';
198
-		$args['type']        = 'kirki-' . $args['type'];
193
+		$args[ 'id' ]          = esc_attr( $id );
194
+		$args[ 'panel' ]       = ( isset( $args[ 'panel' ] ) ) ? esc_attr( $args[ 'panel' ] ) : '';
195
+		$args[ 'description' ] = ( isset( $args[ 'description' ] ) ) ? $args[ 'description' ] : '';
196
+		$args[ 'priority' ]    = ( isset( $args[ 'priority' ] ) ) ? absint( $args[ 'priority' ] ) : 10;
197
+		$args[ 'type' ]        = ( isset( $args[ 'type' ] ) ) ? $args[ 'type' ] : 'default';
198
+		$args[ 'type' ]        = 'kirki-' . $args[ 'type' ];
199 199
 
200
-		self::$sections[ $args['id'] ] = $args;
200
+		self::$sections[ $args[ 'id' ] ] = $args;
201 201
 	}
202 202
 
203 203
 	/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 */
211 211
 	public static function remove_section( $id = '' ) {
212 212
 		if ( ! in_array( $id, self::$sections_to_remove, true ) ) {
213
-			self::$sections_to_remove[] = $id;
213
+			self::$sections_to_remove[ ] = $id;
214 214
 		}
215 215
 	}
216 216
 
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
 		}
230 230
 
231 231
 		// Early exit if 'type' is not defined.
232
-		if ( ! isset( $args['type'] ) ) {
232
+		if ( ! isset( $args[ 'type' ] ) ) {
233 233
 			return;
234 234
 		}
235 235
 
236
-		$str       = str_replace( array( '-', '_' ), ' ', $args['type'] );
236
+		$str       = str_replace( array( '-', '_' ), ' ', $args[ 'type' ] );
237 237
 		$classname = 'Kirki_Field_' . str_replace( ' ', '_', ucwords( $str ) );
238 238
 		if ( class_exists( $classname ) ) {
239 239
 			new $classname( $config_id, $args );
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public static function remove_control( $id ) {
263 263
 		if ( ! in_array( $id, self::$controls_to_remove, true ) ) {
264
-			self::$controls_to_remove[] = $id;
264
+			self::$controls_to_remove[ ] = $id;
265 265
 		}
266 266
 	}
267 267
 
Please login to merge, or discard this patch.
controls/php/class-kirki-control-base.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -136,37 +136,37 @@
 block discarded – undo
136 136
 		// Get the basics from the parent class.
137 137
 		parent::to_json();
138 138
 		// Default.
139
-		$this->json['default'] = $this->setting->default;
139
+		$this->json[ 'default' ] = $this->setting->default;
140 140
 		if ( isset( $this->default ) ) {
141
-			$this->json['default'] = $this->default;
141
+			$this->json[ 'default' ] = $this->default;
142 142
 		}
143 143
 		// Required.
144
-		$this->json['required'] = $this->required;
144
+		$this->json[ 'required' ] = $this->required;
145 145
 		// Output.
146
-		$this->json['output'] = $this->output;
146
+		$this->json[ 'output' ] = $this->output;
147 147
 		// Value.
148
-		$this->json['value'] = $this->value();
148
+		$this->json[ 'value' ] = $this->value();
149 149
 		// Choices.
150
-		$this->json['choices'] = $this->choices;
150
+		$this->json[ 'choices' ] = $this->choices;
151 151
 		// The link.
152
-		$this->json['link'] = $this->get_link();
152
+		$this->json[ 'link' ] = $this->get_link();
153 153
 		// The ID.
154
-		$this->json['id'] = $this->id;
154
+		$this->json[ 'id' ] = $this->id;
155 155
 		// Translation strings.
156
-		$this->json['l10n'] = $this->l10n();
156
+		$this->json[ 'l10n' ] = $this->l10n();
157 157
 		// The ajaxurl in case we need it.
158
-		$this->json['ajaxurl'] = admin_url( 'admin-ajax.php' );
158
+		$this->json[ 'ajaxurl' ] = admin_url( 'admin-ajax.php' );
159 159
 		// Input attributes.
160
-		$this->json['inputAttrs'] = '';
160
+		$this->json[ 'inputAttrs' ] = '';
161 161
 		foreach ( $this->input_attrs as $attr => $value ) {
162
-			$this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
162
+			$this->json[ 'inputAttrs' ] .= $attr . '="' . esc_attr( $value ) . '" ';
163 163
 		}
164 164
 		// The kirki-config.
165
-		$this->json['kirkiConfig'] = $this->kirki_config;
165
+		$this->json[ 'kirkiConfig' ] = $this->kirki_config;
166 166
 		// The option-type.
167
-		$this->json['kirkiOptionType'] = $this->option_type;
167
+		$this->json[ 'kirkiOptionType' ] = $this->option_type;
168 168
 		// The option-name.
169
-		$this->json['kirkiOptionName'] = $this->option_name;
169
+		$this->json[ 'kirkiOptionName' ] = $this->option_name;
170 170
 	}
171 171
 
172 172
 	/**
Please login to merge, or discard this patch.