Completed
Pull Request — master (#1710)
by Aristeides
04:22 queued 02:20
created
core/class-kirki-control.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 		// Set a default class name.
67 67
 		$class_name = 'WP_Customize_Control';
68 68
 		// Get the classname from the array of control classnames.
69
-		if ( array_key_exists( $args['type'], self::$control_types ) ) {
70
-			$class_name = self::$control_types[ $args['type'] ];
69
+		if ( array_key_exists( $args[ 'type' ], self::$control_types ) ) {
70
+			$class_name = self::$control_types[ $args[ 'type' ] ];
71 71
 		}
72 72
 		return $class_name;
73 73
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		// Get the name of the class we're going to use.
85 85
 		$class_name = $this->get_control_class_name( $args );
86 86
 		// Add the control.
87
-		$this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) );
87
+		$this->wp_customize->add_control( new $class_name( $this->wp_customize, $args[ 'settings' ], $args ) );
88 88
 
89 89
 	}
90 90
 
Please login to merge, or discard this patch.
field/class-kirki-field-code.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  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 65
 
66
-		switch ( $this->choices['language'] ) {
66
+		switch ( $this->choices[ 'language' ] ) {
67 67
 			case 'css':
68 68
 			case 'html':
69 69
 			case 'htmlmixed':
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
 			case 'markdown':
74 74
 			case 'md':
75 75
 			case 'xml':
76
-				if ( 'md' === $this->choices['language'] ) {
77
-					$this->choices['language'] = 'markdown';
78
-				} elseif ( 'htm' === $this->choices['language'] || 'htmlmixed' === $this->choices['language'] ) {
79
-					$this->choices['language'] = 'html';
76
+				if ( 'md' === $this->choices[ 'language' ] ) {
77
+					$this->choices[ 'language' ] = 'markdown';
78
+				} elseif ( 'htm' === $this->choices[ 'language' ] || 'htmlmixed' === $this->choices[ 'language' ] ) {
79
+					$this->choices[ 'language' ] = 'html';
80 80
 				}
81
-				$this->code_type = 'text/' . $this->choices['language'];
82
-				if ( 'html' === $this->choices['language'] ) {
83
-					$this->choices['language'] = 'htmlmixed';
81
+				$this->code_type = 'text/' . $this->choices[ 'language' ];
82
+				if ( 'html' === $this->choices[ 'language' ] ) {
83
+					$this->choices[ 'language' ] = 'htmlmixed';
84 84
 				}
85 85
 				break;
86 86
 			case 'http':
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 			case 'php5':
94 94
 			case 'php7':
95 95
 			case 'phps':
96
-				if ( 'js' === $this->choices['language'] ) {
97
-					$this->choices['language'] = 'javascript';
98
-				} elseif ( in_array( $this->choices['language'], array( 'phtml', 'php3', 'php4', 'php5', 'php7', 'phps' ), true ) ) {
99
-					$this->choices['language'] = 'php';
96
+				if ( 'js' === $this->choices[ 'language' ] ) {
97
+					$this->choices[ 'language' ] = 'javascript';
98
+				} elseif ( in_array( $this->choices[ 'language' ], array( 'phtml', 'php3', 'php4', 'php5', 'php7', 'phps' ), true ) ) {
99
+					$this->choices[ 'language' ] = 'php';
100 100
 				}
101
-				$this->code_type = 'application/' . $this->choices['language'];
101
+				$this->code_type = 'application/' . $this->choices[ 'language' ];
102 102
 				break;
103 103
 			case 'svg':
104 104
 				$this->code_type = 'image/svg-xml';
@@ -107,14 +107,14 @@  discard block
 block discarded – undo
107 107
 				$this->code_type = 'text/plain';
108 108
 				break;
109 109
 			default:
110
-				$this->code_type = 'text/x-' . $this->choices['language'];
110
+				$this->code_type = 'text/x-' . $this->choices[ 'language' ];
111 111
 				break;
112 112
 		}
113
-		if ( ! isset( $this->editor_settings['codemirror'] ) ) {
114
-			$this->editor_settings['codemirror'] = array();
113
+		if ( ! isset( $this->editor_settings[ 'codemirror' ] ) ) {
114
+			$this->editor_settings[ 'codemirror' ] = array();
115 115
 		}
116
-		if ( ! isset( $this->editor_settings['codemirror']['mode'] ) ) {
117
-			$this->editor_settings['codemirror']['mode'] = $this->choices['language'];
116
+		if ( ! isset( $this->editor_settings[ 'codemirror' ][ 'mode' ] ) ) {
117
+			$this->editor_settings[ 'codemirror' ][ 'mode' ] = $this->choices[ 'language' ];
118 118
 		}
119 119
 	}
120 120
 
Please login to merge, or discard this patch.
controls/php/class-kirki-control-select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 	public function to_json() {
54 54
 		parent::to_json();
55 55
 
56
-		$this->json['multiple'] = $this->multiple;
57
-		$this->json['placeholder'] = $this->placeholder;
56
+		$this->json[ 'multiple' ] = $this->multiple;
57
+		$this->json[ 'placeholder' ] = $this->placeholder;
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.
field/class-kirki-field-repeater.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,15 +97,15 @@  discard block
 block discarded – undo
97 97
 					unset( $value[ $row_id ][ $subfield_id ] );
98 98
 				}
99 99
 				// Get the subfield-type.
100
-				if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) {
100
+				if ( ! isset( $this->fields[ $subfield_id ][ 'type' ] ) ) {
101 101
 					continue;
102 102
 				}
103
-				$subfield_type = $this->fields[ $subfield_id ]['type'];
103
+				$subfield_type = $this->fields[ $subfield_id ][ 'type' ];
104 104
 
105 105
 				// Allow using a sanitize-callback on a per-field basis.
106
-				if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) {
106
+				if ( isset( $this->fields[ $subfield_id ][ 'sanitize_callback' ] ) ) {
107 107
 
108
-					$subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value );
108
+					$subfield_value = call_user_func( $this->fields[ $subfield_id ][ 'sanitize_callback' ], $subfield_value );
109 109
 
110 110
 				} else {
111 111
 
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 							$subfield_value = (bool) $subfield_value;
143 143
 							break;
144 144
 						case 'select':
145
-							if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) {
146
-								if ( true === $this->fields[ $subfield_id ]['multiple'] ) {
145
+							if ( isset( $this->fields[ $subfield_id ][ 'multiple' ] ) ) {
146
+								if ( true === $this->fields[ $subfield_id ][ 'multiple' ] ) {
147 147
 									$multiple = 2;
148 148
 								}
149
-								$multiple = (int) $this->fields[ $subfield_id ]['multiple'];
149
+								$multiple = (int) $this->fields[ $subfield_id ][ 'multiple' ];
150 150
 								if ( 1 < $multiple ) {
151 151
 									$subfield_value = (array) $subfield_value;
152 152
 									foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) {
Please login to merge, or discard this patch.