Passed
Push — master ( de7162...f256de )
by Brian
739:27 queued 623:54
created
vendor/ayecode/wp-ayecode-ui/ayecode-ui-loader.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,39 +6,39 @@
 block discarded – undo
6 6
 /**
7 7
  * Bail if we are not in WP.
8 8
  */
9
-if ( ! defined( 'ABSPATH' ) ) {
9
+if (!defined('ABSPATH')) {
10 10
 	exit;
11 11
 }
12 12
 
13 13
 /**
14 14
  * Set the version only if its the current newest while loading.
15 15
  */
16
-add_action('after_setup_theme', function () {
17
-	global $ayecode_ui_version,$ayecode_ui_file_key;
16
+add_action('after_setup_theme', function() {
17
+	global $ayecode_ui_version, $ayecode_ui_file_key;
18 18
 	$this_version = "0.1.11";
19
-	if(version_compare($this_version , $ayecode_ui_version, '>')){
20
-		$ayecode_ui_version = $this_version ;
21
-		$ayecode_ui_file_key = wp_hash( __FILE__ );
19
+	if (version_compare($this_version, $ayecode_ui_version, '>')) {
20
+		$ayecode_ui_version = $this_version;
21
+		$ayecode_ui_file_key = wp_hash(__FILE__);
22 22
 	}
23 23
 },0);
24 24
 
25 25
 /**
26 26
  * Load this version of WP Bootstrap Settings only if the file hash is the current one.
27 27
  */
28
-add_action('after_setup_theme', function () {
28
+add_action('after_setup_theme', function() {
29 29
 	global $ayecode_ui_file_key;
30
-	if($ayecode_ui_file_key && $ayecode_ui_file_key == wp_hash( __FILE__ )){
31
-		include_once( dirname( __FILE__ ) . '/includes/class-aui.php' );
32
-		include_once( dirname( __FILE__ ) . '/includes/ayecode-ui-settings.php' );
30
+	if ($ayecode_ui_file_key && $ayecode_ui_file_key == wp_hash(__FILE__)) {
31
+		include_once(dirname(__FILE__) . '/includes/class-aui.php');
32
+		include_once(dirname(__FILE__) . '/includes/ayecode-ui-settings.php');
33 33
 	}
34 34
 },1);
35 35
 
36 36
 /**
37 37
  * Add the function that calls the class.
38 38
  */
39
-if(!function_exists('aui')){
40
-	function aui(){
41
-		if(!class_exists("AUI",false)){
39
+if (!function_exists('aui')) {
40
+	function aui() {
41
+		if (!class_exists("AUI", false)) {
42 42
 			return false;
43 43
 		}
44 44
 		return AUI::instance();
Please login to merge, or discard this patch.
ayecode/wp-ayecode-ui/includes/components/class-aui-component-input.php 1 patch
Spacing   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string The rendered component.
20 20
 	 */
21
-	public static function input($args = array()){
21
+	public static function input($args = array()) {
22 22
 		$defaults = array(
23 23
 			'type'       => 'text',
24 24
 			'name'       => '',
@@ -48,91 +48,91 @@  discard block
 block discarded – undo
48 48
 		/**
49 49
 		 * Parse incoming $args into an array and merge it with $defaults
50 50
 		 */
51
-		$args   = wp_parse_args( $args, $defaults );
51
+		$args   = wp_parse_args($args, $defaults);
52 52
 		$output = '';
53
-		if ( ! empty( $args['type'] ) ) {
54
-			$type = sanitize_html_class( $args['type'] );
55
-			$label_args = array('title'=>$args['label'],'for'=>$args['id'],'class' => $args['label_class']." ");
53
+		if (!empty($args['type'])) {
54
+			$type = sanitize_html_class($args['type']);
55
+			$label_args = array('title'=>$args['label'], 'for'=>$args['id'], 'class' => $args['label_class'] . " ");
56 56
 			
57 57
 			// Some special sauce for files
58
-			if($type=='file' ){
58
+			if ($type == 'file') {
59 59
 				$args['label_after'] = true; // if type file we need the label after
60 60
 				$args['class'] .= ' custom-file-input ';
61
-			}elseif($type=='checkbox'){
61
+			}elseif ($type == 'checkbox') {
62 62
 				$args['label_after'] = true; // if type file we need the label after
63 63
 				$args['class'] .= ' custom-control-input ';
64 64
 			}
65 65
 
66 66
 
67 67
 			// label before
68
-			if(!empty($args['label']) && !$args['label_after']){
69
-				if($type == 'file'){$label_args['class'] .= 'custom-file-label';}
70
-				$output .= self::label( $label_args, $type );
68
+			if (!empty($args['label']) && !$args['label_after']) {
69
+				if ($type == 'file') {$label_args['class'] .= 'custom-file-label'; }
70
+				$output .= self::label($label_args, $type);
71 71
 			}
72 72
 
73 73
 			// open/type
74 74
 			$output .= '<input type="' . $type . '" ';
75 75
 
76 76
 			// name
77
-			if(!empty($args['name'])){
78
-				$output .= ' name="'.sanitize_html_class($args['name']).'" ';
77
+			if (!empty($args['name'])) {
78
+				$output .= ' name="' . sanitize_html_class($args['name']) . '" ';
79 79
 			}
80 80
 
81 81
 			// id
82
-			if(!empty($args['id'])){
83
-				$output .= ' id="'.sanitize_html_class($args['id']).'" ';
82
+			if (!empty($args['id'])) {
83
+				$output .= ' id="' . sanitize_html_class($args['id']) . '" ';
84 84
 			}
85 85
 
86 86
 			// placeholder
87
-			if(!empty($args['placeholder'])){
88
-				$output .= ' placeholder="'.esc_attr($args['placeholder']).'" ';
87
+			if (!empty($args['placeholder'])) {
88
+				$output .= ' placeholder="' . esc_attr($args['placeholder']) . '" ';
89 89
 			}
90 90
 
91 91
 			// title
92
-			if(!empty($args['title'])){
93
-				$output .= ' title="'.esc_attr($args['title']).'" ';
92
+			if (!empty($args['title'])) {
93
+				$output .= ' title="' . esc_attr($args['title']) . '" ';
94 94
 			}
95 95
 
96 96
 			// value
97
-			if(!empty($args['value'])){
98
-				$output .= ' value="'.sanitize_text_field($args['value']).'" ';
97
+			if (!empty($args['value'])) {
98
+				$output .= ' value="' . sanitize_text_field($args['value']) . '" ';
99 99
 			}
100 100
 
101 101
 			// checked, for radio and checkboxes
102
-			if( ( $type == 'checkbox' || $type == 'radio' ) && $args['checked'] ){
102
+			if (($type == 'checkbox' || $type == 'radio') && $args['checked']) {
103 103
 				$output .= ' checked ';
104 104
 			}
105 105
 
106 106
 			// validation text
107
-			if(!empty($args['validation_text'])){
108
-				$output .= ' oninvalid="setCustomValidity(\''.esc_attr($args['validation_text']).'\')" ';
107
+			if (!empty($args['validation_text'])) {
108
+				$output .= ' oninvalid="setCustomValidity(\'' . esc_attr($args['validation_text']) . '\')" ';
109 109
 				$output .= ' onchange="try{setCustomValidity(\'\')}catch(e){}" ';
110 110
 			}
111 111
 
112 112
 			// validation_pattern
113
-			if(!empty($args['validation_pattern'])){
114
-				$output .= ' pattern="'.$args['validation_pattern'].'" ';
113
+			if (!empty($args['validation_pattern'])) {
114
+				$output .= ' pattern="' . $args['validation_pattern'] . '" ';
115 115
 			}
116 116
 
117 117
 			// step (for numbers)
118
-			if(!empty($args['step'])){
119
-				$output .= ' step="'.$args['step'].'" ';
118
+			if (!empty($args['step'])) {
119
+				$output .= ' step="' . $args['step'] . '" ';
120 120
 			}
121 121
 
122 122
 			// required
123
-			if(!empty($args['required'])){
123
+			if (!empty($args['required'])) {
124 124
 				$output .= ' required ';
125 125
 			}
126 126
 
127 127
 			// class
128 128
 			$class = !empty($args['class']) ? $args['class'] : '';
129
-			$output .= ' class="form-control '.$class.'" ';
129
+			$output .= ' class="form-control ' . $class . '" ';
130 130
 
131 131
 			// data-attributes
132 132
 			$output .= AUI_Component_Helper::data_attributes($args);
133 133
 
134 134
 			// extra attributes
135
-			if(!empty($args['extra_attributes'])){
135
+			if (!empty($args['extra_attributes'])) {
136 136
 				$output .= AUI_Component_Helper::extra_attributes($args['extra_attributes']);
137 137
 			}
138 138
 
@@ -140,26 +140,26 @@  discard block
 block discarded – undo
140 140
 			$output .= ' >';
141 141
 
142 142
 			// label after
143
-			if(!empty($args['label']) && $args['label_after']){
144
-				if($type == 'file'){$label_args['class'] .= 'custom-file-label';}
145
-				elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';}
146
-				$output .= self::label( $label_args, $type );
143
+			if (!empty($args['label']) && $args['label_after']) {
144
+				if ($type == 'file') {$label_args['class'] .= 'custom-file-label'; }
145
+				elseif ($type == 'checkbox') {$label_args['class'] .= 'custom-control-label'; }
146
+				$output .= self::label($label_args, $type);
147 147
 			}
148 148
 
149 149
 			
150 150
 			// some input types need a separate wrap
151
-			if($type == 'file') {
152
-				$output = self::wrap( array(
151
+			if ($type == 'file') {
152
+				$output = self::wrap(array(
153 153
 					'content' => $output,
154 154
 					'class'   => 'form-group custom-file'
155
-				) );
156
-			}elseif($type == 'checkbox'){
155
+				));
156
+			}elseif ($type == 'checkbox') {
157 157
 				$wrap_class = $args['switch'] ? 'custom-switch' : 'custom-checkbox';
158
-				$output = self::wrap( array(
158
+				$output = self::wrap(array(
159 159
 					'content' => $output,
160
-					'class'   => 'custom-control '.$wrap_class
161
-				) );
162
-			}elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){
160
+					'class'   => 'custom-control ' . $wrap_class
161
+				));
162
+			}elseif ($type == 'password' && $args['password_toggle'] && !$args['input_group_right']) {
163 163
 
164 164
 
165 165
 				// allow password field to toggle view
@@ -173,32 +173,32 @@  discard block
 block discarded – undo
173 173
 			}
174 174
 
175 175
 			// input group wraps
176
-			if($args['input_group_left'] || $args['input_group_right']){
176
+			if ($args['input_group_left'] || $args['input_group_right']) {
177 177
 				$w100 = strpos($args['class'], 'w-100') !== false ? ' w-100' : '';
178
-				if($args['input_group_left']){
179
-					$output = self::wrap( array(
178
+				if ($args['input_group_left']) {
179
+					$output = self::wrap(array(
180 180
 						'content' => $output,
181
-						'class'   => $args['input_group_left_inside'] ? 'input-group-inside'.$w100  : 'input-group',
181
+						'class'   => $args['input_group_left_inside'] ? 'input-group-inside' . $w100 : 'input-group',
182 182
 						'input_group_left' => $args['input_group_left'],
183 183
 						'input_group_left_inside'    => $args['input_group_left_inside']
184
-					) );
184
+					));
185 185
 				}
186
-				if($args['input_group_right']){
187
-					$output = self::wrap( array(
186
+				if ($args['input_group_right']) {
187
+					$output = self::wrap(array(
188 188
 						'content' => $output,
189
-						'class'   => $args['input_group_right_inside'] ? 'input-group-inside'.$w100 : 'input-group',
189
+						'class'   => $args['input_group_right_inside'] ? 'input-group-inside' . $w100 : 'input-group',
190 190
 						'input_group_right' => $args['input_group_right'],
191 191
 						'input_group_right_inside'    => $args['input_group_right_inside']
192
-					) );
192
+					));
193 193
 				}
194 194
 
195 195
 				// Labels need to be on the outside of the wrap
196
-				$label = self::label( $label_args, $type );
197
-				$output = $label . str_replace($label,"",$output);
196
+				$label = self::label($label_args, $type);
197
+				$output = $label . str_replace($label, "", $output);
198 198
 			}
199 199
 
200 200
 			// wrap
201
-			if(!$args['no_wrap']){
201
+			if (!$args['no_wrap']) {
202 202
 				$output = self::wrap(array(
203 203
 					'content' => $output,
204 204
 				));
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 *
219 219
 	 * @return string The rendered component.
220 220
 	 */
221
-	public static function textarea($args = array()){
221
+	public static function textarea($args = array()) {
222 222
 		$defaults = array(
223 223
 			'name'       => '',
224 224
 			'class'      => '',
@@ -238,16 +238,16 @@  discard block
 block discarded – undo
238 238
 		/**
239 239
 		 * Parse incoming $args into an array and merge it with $defaults
240 240
 		 */
241
-		$args   = wp_parse_args( $args, $defaults );
241
+		$args   = wp_parse_args($args, $defaults);
242 242
 		$output = '';
243 243
 
244 244
 		// label
245
-		if(!empty($args['label']) && is_array($args['label'])){
246
-		}elseif(!empty($args['label'])){
247
-			$output .= self::label(array('title'=>$args['label'],'for'=>$args['id']));
245
+		if (!empty($args['label']) && is_array($args['label'])) {
246
+		}elseif (!empty($args['label'])) {
247
+			$output .= self::label(array('title'=>$args['label'], 'for'=>$args['id']));
248 248
 		}
249 249
 
250
-		if(!empty($args['wysiwyg'])){
250
+		if (!empty($args['wysiwyg'])) {
251 251
 			ob_start();
252 252
 			$content = $args['value'];
253 253
 			$editor_id = !empty($args['id']) ? sanitize_html_class($args['id']) : 'wp_editor';
@@ -261,69 +261,69 @@  discard block
 block discarded – undo
261 261
 			);
262 262
 
263 263
 			// maybe set settings if array
264
-			if(is_array($args['wysiwyg'])){
265
-				$settings  = wp_parse_args( $args['wysiwyg'], $settings );
264
+			if (is_array($args['wysiwyg'])) {
265
+				$settings = wp_parse_args($args['wysiwyg'], $settings);
266 266
 			}
267 267
 
268
-			wp_editor( $content, $editor_id, $settings );
268
+			wp_editor($content, $editor_id, $settings);
269 269
 			$output .= ob_get_clean();
270
-		}else{
270
+		} else {
271 271
 
272 272
 			// open
273 273
 			$output .= '<textarea ';
274 274
 
275 275
 			// name
276
-			if(!empty($args['name'])){
277
-				$output .= ' name="'.sanitize_html_class($args['name']).'" ';
276
+			if (!empty($args['name'])) {
277
+				$output .= ' name="' . sanitize_html_class($args['name']) . '" ';
278 278
 			}
279 279
 
280 280
 			// id
281
-			if(!empty($args['id'])){
282
-				$output .= ' id="'.sanitize_html_class($args['id']).'" ';
281
+			if (!empty($args['id'])) {
282
+				$output .= ' id="' . sanitize_html_class($args['id']) . '" ';
283 283
 			}
284 284
 
285 285
 			// placeholder
286
-			if(!empty($args['placeholder'])){
287
-				$output .= ' placeholder="'.esc_attr($args['placeholder']).'" ';
286
+			if (!empty($args['placeholder'])) {
287
+				$output .= ' placeholder="' . esc_attr($args['placeholder']) . '" ';
288 288
 			}
289 289
 
290 290
 			// title
291
-			if(!empty($args['title'])){
292
-				$output .= ' title="'.esc_attr($args['title']).'" ';
291
+			if (!empty($args['title'])) {
292
+				$output .= ' title="' . esc_attr($args['title']) . '" ';
293 293
 			}
294 294
 
295 295
 			// validation text
296
-			if(!empty($args['validation_text'])){
297
-				$output .= ' oninvalid="setCustomValidity(\''.esc_attr($args['validation_text']).'\')" ';
296
+			if (!empty($args['validation_text'])) {
297
+				$output .= ' oninvalid="setCustomValidity(\'' . esc_attr($args['validation_text']) . '\')" ';
298 298
 				$output .= ' onchange="try{setCustomValidity(\'\')}catch(e){}" ';
299 299
 			}
300 300
 
301 301
 			// validation_pattern
302
-			if(!empty($args['validation_pattern'])){
303
-				$output .= ' pattern="'.$args['validation_pattern'].'" ';
302
+			if (!empty($args['validation_pattern'])) {
303
+				$output .= ' pattern="' . $args['validation_pattern'] . '" ';
304 304
 			}
305 305
 
306 306
 			// required
307
-			if(!empty($args['required'])){
307
+			if (!empty($args['required'])) {
308 308
 				$output .= ' required ';
309 309
 			}
310 310
 
311 311
 			// rows
312
-			if(!empty($args['rows'])){
313
-				$output .= ' rows="'.absint($args['rows']).'" ';
312
+			if (!empty($args['rows'])) {
313
+				$output .= ' rows="' . absint($args['rows']) . '" ';
314 314
 			}
315 315
 
316 316
 
317 317
 			// class
318 318
 			$class = !empty($args['class']) ? $args['class'] : '';
319
-			$output .= ' class="form-control '.$class.'" ';
319
+			$output .= ' class="form-control ' . $class . '" ';
320 320
 
321 321
 
322 322
 			// close tag
323 323
 			$output .= ' >';
324 324
 
325 325
 			// value
326
-			if(!empty($args['value'])){
326
+			if (!empty($args['value'])) {
327 327
 				$output .= sanitize_textarea_field($args['value']);
328 328
 			}
329 329
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
 
336 336
 		// wrap
337
-		if(!$args['no_wrap']){
337
+		if (!$args['no_wrap']) {
338 338
 			$output = self::wrap(array(
339 339
 				'content' => $output,
340 340
 			));
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 		return $output;
348 348
 	}
349 349
 
350
-	public static function label($args = array(), $type = ''){
350
+	public static function label($args = array(), $type = '') {
351 351
 		//<label for="exampleInputEmail1">Email address</label>
352 352
 		$defaults = array(
353 353
 			'title'       => 'div',
@@ -358,16 +358,16 @@  discard block
 block discarded – undo
358 358
 		/**
359 359
 		 * Parse incoming $args into an array and merge it with $defaults
360 360
 		 */
361
-		$args   = wp_parse_args( $args, $defaults );
361
+		$args   = wp_parse_args($args, $defaults);
362 362
 		$output = '';
363 363
 
364
-		if($args['title']){
364
+		if ($args['title']) {
365 365
 
366 366
 			// maybe hide labels //@todo set a global option for visibility class
367
-			if($type == 'file' || $type == 'checkbox'){
367
+			if ($type == 'file' || $type == 'checkbox') {
368 368
 				$class = $args['class'];
369
-			}else{
370
-				$class = 'sr-only '.$args['class'];
369
+			} else {
370
+				$class = 'sr-only ' . $args['class'];
371 371
 			}
372 372
 
373 373
 
@@ -375,19 +375,19 @@  discard block
 block discarded – undo
375 375
 			$output .= '<label ';
376 376
 
377 377
 			// for
378
-			if(!empty($args['for'])){
379
-				$output .= ' for="'.sanitize_text_field($args['for']).'" ';
378
+			if (!empty($args['for'])) {
379
+				$output .= ' for="' . sanitize_text_field($args['for']) . '" ';
380 380
 			}
381 381
 
382 382
 			// class
383
-			$output .= ' class="'.$class.'" ';
383
+			$output .= ' class="' . $class . '" ';
384 384
 
385 385
 			// close
386 386
 			$output .= '>';
387 387
 
388 388
 
389 389
 			// title
390
-			if(!empty($args['title'])){
390
+			if (!empty($args['title'])) {
391 391
 				$output .= esc_attr($args['title']);
392 392
 			}
393 393
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		return $output;
402 402
 	}
403 403
 
404
-	public static function wrap($args = array()){
404
+	public static function wrap($args = array()) {
405 405
 		$defaults = array(
406 406
 			'type'       => 'div',
407 407
 			'class'      => 'form-group',
@@ -415,44 +415,44 @@  discard block
 block discarded – undo
415 415
 		/**
416 416
 		 * Parse incoming $args into an array and merge it with $defaults
417 417
 		 */
418
-		$args   = wp_parse_args( $args, $defaults );
418
+		$args   = wp_parse_args($args, $defaults);
419 419
 		$output = '';
420
-		if($args['type']){
420
+		if ($args['type']) {
421 421
 
422 422
 			// open
423
-			$output .= '<'.sanitize_html_class($args['type']);
423
+			$output .= '<' . sanitize_html_class($args['type']);
424 424
 
425 425
 			// class
426 426
 			$class = !empty($args['class']) ? $args['class'] : '';
427
-			$output .= ' class="'.$class.'" ';
427
+			$output .= ' class="' . $class . '" ';
428 428
 
429 429
 			// close wrap
430 430
 			$output .= ' >';
431 431
 
432 432
 
433 433
 			// Input group left
434
-			if(!empty($args['input_group_left'])){
434
+			if (!empty($args['input_group_left'])) {
435 435
 				$position_class = !empty($args['input_group_left_inside']) ? 'position-absolute' : '';
436
-				$input_group_left = strpos($args['input_group_left'], '<') !== false ? $args['input_group_left'] : '<span class="input-group-text">'.$args['input_group_left'].'</span>';
437
-				$output .= '<div class="input-group-prepend '.$position_class.'">'.$input_group_left.'</div>';
436
+				$input_group_left = strpos($args['input_group_left'], '<') !== false ? $args['input_group_left'] : '<span class="input-group-text">' . $args['input_group_left'] . '</span>';
437
+				$output .= '<div class="input-group-prepend ' . $position_class . '">' . $input_group_left . '</div>';
438 438
 			}
439 439
 
440 440
 			// content
441 441
 			$output .= $args['content'];
442 442
 
443 443
 			// Input group right
444
-			if(!empty($args['input_group_right'])){
444
+			if (!empty($args['input_group_right'])) {
445 445
 				$position_class = !empty($args['input_group_left_inside']) ? 'position-absolute' : '';
446
-				$input_group_right = strpos($args['input_group_right'], '<') !== false ? $args['input_group_right'] : '<span class="input-group-text">'.$args['input_group_right'].'</span>';
447
-				$output .= '<div class="input-group-append '.$position_class.'">'.$input_group_right.'</div>';
446
+				$input_group_right = strpos($args['input_group_right'], '<') !== false ? $args['input_group_right'] : '<span class="input-group-text">' . $args['input_group_right'] . '</span>';
447
+				$output .= '<div class="input-group-append ' . $position_class . '">' . $input_group_right . '</div>';
448 448
 			}
449 449
 
450 450
 
451 451
 			// close wrap
452
-			$output .= '</'.sanitize_html_class($args['type']).'>';
452
+			$output .= '</' . sanitize_html_class($args['type']) . '>';
453 453
 
454 454
 
455
-		}else{
455
+		} else {
456 456
 			$output = $args['content'];
457 457
 		}
458 458
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 	 *
467 467
 	 * @return string The rendered component.
468 468
 	 */
469
-	public static function select($args = array()){
469
+	public static function select($args = array()) {
470 470
 		$defaults = array(
471 471
 			'class'      => '',
472 472
 			'id'         => '',
@@ -485,35 +485,35 @@  discard block
 block discarded – undo
485 485
 		/**
486 486
 		 * Parse incoming $args into an array and merge it with $defaults
487 487
 		 */
488
-		$args   = wp_parse_args( $args, $defaults );
488
+		$args   = wp_parse_args($args, $defaults);
489 489
 		$output = '';
490 490
 
491 491
 		// Maybe setup select2
492 492
 		$is_select2 = false;
493
-		if(!empty($args['select2'])){
493
+		if (!empty($args['select2'])) {
494 494
 			$args['class'] .= ' aui-select2';
495 495
 			$is_select2 = true;
496
-		}elseif( strpos($args['class'], 'aui-select2') !== false){
496
+		}elseif (strpos($args['class'], 'aui-select2') !== false) {
497 497
 			$is_select2 = true;
498 498
 		}
499 499
 
500 500
 		// select2 tags
501
-		if( !empty($args['select2']) && $args['select2'] === 'tags'){ // triple equlas needed here for some reason
501
+		if (!empty($args['select2']) && $args['select2'] === 'tags') { // triple equlas needed here for some reason
502 502
 			$args['data-tags'] = 'true';
503 503
 			$args['data-token-separators'] = "[',']";
504 504
 			$args['multiple'] = true;
505 505
 		}
506 506
 
507 507
 		// select2 placeholder
508
-		if($is_select2 && !empty($args['placeholder']) && empty($args['data-placeholder'])){
508
+		if ($is_select2 && !empty($args['placeholder']) && empty($args['data-placeholder'])) {
509 509
 			$args['data-placeholder'] = esc_attr($args['placeholder']);
510 510
 			$args['data-allow-clear'] = empty($args['data-allow-clear']) ? true : esc_attr($args['data-allow-clear']);
511 511
 		}
512 512
 
513 513
 		// label
514
-		if(!empty($args['label']) && is_array($args['label'])){
515
-		}elseif(!empty($args['label'])){
516
-			$output .= self::label(array('title'=>$args['label'],'for'=>$args['id']));
514
+		if (!empty($args['label']) && is_array($args['label'])) {
515
+		}elseif (!empty($args['label'])) {
516
+			$output .= self::label(array('title'=>$args['label'], 'for'=>$args['id']));
517 517
 		}
518 518
 
519 519
 		// open/type
@@ -521,20 +521,20 @@  discard block
 block discarded – undo
521 521
 
522 522
 		// class
523 523
 		$class = !empty($args['class']) ? $args['class'] : '';
524
-		$output .= AUI_Component_Helper::class_attr('custom-select '.$class);
524
+		$output .= AUI_Component_Helper::class_attr('custom-select ' . $class);
525 525
 
526 526
 		// name
527
-		if(!empty($args['name'])){
528
-			$output .= AUI_Component_Helper::name($args['name'],$args['multiple']);
527
+		if (!empty($args['name'])) {
528
+			$output .= AUI_Component_Helper::name($args['name'], $args['multiple']);
529 529
 		}
530 530
 
531 531
 		// id
532
-		if(!empty($args['id'])){
532
+		if (!empty($args['id'])) {
533 533
 			$output .= AUI_Component_Helper::id($args['id']);
534 534
 		}
535 535
 
536 536
 		// title
537
-		if(!empty($args['title'])){
537
+		if (!empty($args['title'])) {
538 538
 			$output .= AUI_Component_Helper::title($args['title']);
539 539
 		}
540 540
 
@@ -545,12 +545,12 @@  discard block
 block discarded – undo
545 545
 		$output .= AUI_Component_Helper::aria_attributes($args);
546 546
 
547 547
 		// required
548
-		if(!empty($args['required'])){
548
+		if (!empty($args['required'])) {
549 549
 			$output .= ' required ';
550 550
 		}
551 551
 
552 552
 		// multiple
553
-		if(!empty($args['multiple'])){
553
+		if (!empty($args['multiple'])) {
554 554
 			$output .= ' multiple ';
555 555
 		}
556 556
 
@@ -558,14 +558,14 @@  discard block
 block discarded – undo
558 558
 		$output .= ' >';
559 559
 
560 560
 		// placeholder
561
-		if(!empty($args['placeholder']) && !$is_select2){
562
-			$output .= '<option value="" disabled selected hidden>'.esc_attr($args['placeholder']).'</option>';
561
+		if (!empty($args['placeholder']) && !$is_select2) {
562
+			$output .= '<option value="" disabled selected hidden>' . esc_attr($args['placeholder']) . '</option>';
563 563
 		}
564 564
 
565 565
 		// Options
566
-		if(!empty($args['options'])){
567
-			foreach($args['options'] as $val => $name){
568
-				if(is_array($name)){
566
+		if (!empty($args['options'])) {
567
+			foreach ($args['options'] as $val => $name) {
568
+				if (is_array($name)) {
569 569
 					if (isset($name['optgroup']) && ($name['optgroup'] == 'start' || $name['optgroup'] == 'end')) {
570 570
 						$option_label = isset($name['label']) ? $name['label'] : '';
571 571
 
@@ -574,24 +574,24 @@  discard block
 block discarded – undo
574 574
 						$option_label = isset($name['label']) ? $name['label'] : '';
575 575
 						$option_value = isset($name['value']) ? $name['value'] : '';
576 576
 
577
-						if(!empty($args['multiple']) && !empty($args['value'])){
577
+						if (!empty($args['multiple']) && !empty($args['value'])) {
578 578
 							$selected = in_array($option_value, stripslashes_deep($args['value'])) ? "selected" : "";
579 579
 						} else {
580
-							$selected = selected($option_value,stripslashes_deep($args['value']), false);
580
+							$selected = selected($option_value, stripslashes_deep($args['value']), false);
581 581
 						}
582 582
 
583 583
 						$output .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
584 584
 					}
585
-				}else{
585
+				} else {
586 586
 					$selected = '';
587
-					if(!empty($args['value'])){
588
-						if(is_array($args['value'])){
589
-							$selected = in_array($val,$args['value']) ? 'selected="selected"' : '';
590
-						}else{
591
-							$selected = selected( $args['value'], $val, false);
587
+					if (!empty($args['value'])) {
588
+						if (is_array($args['value'])) {
589
+							$selected = in_array($val, $args['value']) ? 'selected="selected"' : '';
590
+						} else {
591
+							$selected = selected($args['value'], $val, false);
592 592
 						}
593 593
 					}
594
-					$output .= '<option value="'.esc_attr($val).'" '.$selected.'>'.esc_attr($name).'</option>';	
594
+					$output .= '<option value="' . esc_attr($val) . '" ' . $selected . '>' . esc_attr($name) . '</option>';	
595 595
 				}
596 596
 			}
597 597
 
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 		$output .= '</select>';
602 602
 
603 603
 		// wrap
604
-		if(!$args['no_wrap']){
604
+		if (!$args['no_wrap']) {
605 605
 			$output = self::wrap(array(
606 606
 				'content' => $output,
607 607
 			));
Please login to merge, or discard this patch.
ayecode/wp-ayecode-ui/includes/components/class-aui-component-button.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string The rendered component.
20 20
 	 */
21
-	public static function get($args = array()){
21
+	public static function get($args = array()) {
22 22
 		$defaults = array(
23 23
 			'type'       => 'a', // a, button, badge
24 24
 			'href'       => '#',
@@ -40,38 +40,38 @@  discard block
 block discarded – undo
40 40
 		/**
41 41
 		 * Parse incoming $args into an array and merge it with $defaults
42 42
 		 */
43
-		$args   = wp_parse_args( $args, $defaults );
43
+		$args   = wp_parse_args($args, $defaults);
44 44
 		$output = '';
45
-		if ( ! empty( $args['type'] ) ) {
45
+		if (!empty($args['type'])) {
46 46
 			$type = $args['type'] != 'a' ? esc_attr($args['type']) : 'a';
47 47
 
48 48
 			// open/type
49
-			if($type=='a'){
49
+			if ($type == 'a') {
50 50
 				$new_window = !empty($args['new_window']) ? ' target="_blank" ' : '';
51
-				$output .= '<a href="' . $args['href'] . '"'.$new_window;
52
-			}elseif($type=='badge'){
51
+				$output .= '<a href="' . $args['href'] . '"' . $new_window;
52
+			}elseif ($type == 'badge') {
53 53
 				$output .= '<span ';
54
-			}else{
54
+			} else {
55 55
 				$output .= '<button type="' . $type . '" ';
56 56
 			}
57 57
 
58 58
 			// name
59
-			if(!empty($args['name'])){
59
+			if (!empty($args['name'])) {
60 60
 				$output .= AUI_Component_Helper::name($args['name']);
61 61
 			}
62 62
 
63 63
 			// id
64
-			if(!empty($args['id'])){
64
+			if (!empty($args['id'])) {
65 65
 				$output .= AUI_Component_Helper::id($args['id']);
66 66
 			}
67 67
 
68 68
 			// title
69
-			if(!empty($args['title'])){
69
+			if (!empty($args['title'])) {
70 70
 				$output .= AUI_Component_Helper::title($args['title']);
71 71
 			}
72 72
 
73 73
 			// value
74
-			if(!empty($args['value'])){
74
+			if (!empty($args['value'])) {
75 75
 				$output .= AUI_Component_Helper::value($args['value']);
76 76
 			}
77 77
 
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 			$output .= AUI_Component_Helper::aria_attributes($args);
87 87
 
88 88
 			// onclick, we don't escape this
89
-			if(!empty($args['onclick'])){
90
-				$output .= ' onclick="'.$args['onclick'].'" ';
89
+			if (!empty($args['onclick'])) {
90
+				$output .= ' onclick="' . $args['onclick'] . '" ';
91 91
 			}
92 92
 
93 93
 			// style, we don't escape this
94
-			if(!empty($args['style'])){
95
-				$output .= ' style="'.$args['style'].'" ';
94
+			if (!empty($args['style'])) {
95
+				$output .= ' style="' . $args['style'] . '" ';
96 96
 			}
97 97
 
98 98
 			// close opening tag
@@ -101,37 +101,37 @@  discard block
 block discarded – undo
101 101
 
102 102
 			// hover content
103 103
 			$hover_content = false;
104
-			if(!empty($args['hover_content']) || !empty($args['hover_icon'])){
105
-				$output .= "<span class='hover-content'>".AUI_Component_Helper::icon($args['hover_icon'],$args['hover_content']).$args['hover_content']."</span>";
104
+			if (!empty($args['hover_content']) || !empty($args['hover_icon'])) {
105
+				$output .= "<span class='hover-content'>" . AUI_Component_Helper::icon($args['hover_icon'], $args['hover_content']) . $args['hover_content'] . "</span>";
106 106
 				$hover_content = true;
107 107
 			}
108 108
 			
109 109
 			// content
110
-			if($hover_content){$output .= "<span class='hover-content-original'>";}
111
-			if(!empty($args['content']) || !empty($args['icon'])){
112
-				$output .= AUI_Component_Helper::icon($args['icon'],$args['content']).$args['content'];
110
+			if ($hover_content) {$output .= "<span class='hover-content-original'>"; }
111
+			if (!empty($args['content']) || !empty($args['icon'])) {
112
+				$output .= AUI_Component_Helper::icon($args['icon'], $args['content']) . $args['content'];
113 113
 			}
114
-			if($hover_content){$output .= "</span>";}
114
+			if ($hover_content) {$output .= "</span>"; }
115 115
 					
116 116
 
117 117
 
118 118
 			// close
119
-			if($type=='a'){
119
+			if ($type == 'a') {
120 120
 				$output .= '</a>';
121
-			}elseif($type=='badge'){
121
+			}elseif ($type == 'badge') {
122 122
 				$output .= '</span>';
123
-			}else{
123
+			} else {
124 124
 				$output .= '</button>';
125 125
 			}
126 126
 
127 127
 			// maybe new line after?  This adds better spacing between buttons.
128
-			if(!empty($args['new_line_after'])){
128
+			if (!empty($args['new_line_after'])) {
129 129
 				$output .= PHP_EOL;
130 130
 			}
131 131
 
132 132
 
133 133
 			// wrap
134
-			if(!$args['no_wrap']){
134
+			if (!$args['no_wrap']) {
135 135
 				$output = AUI_Component_Input::wrap(array(
136 136
 					'content' => $output,
137 137
 				));
Please login to merge, or discard this patch.
ayecode/wp-ayecode-ui/includes/components/class-aui-component-helper.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string
20 20
 	 */
21
-	public static function name($text,$multiple = false){
21
+	public static function name($text, $multiple = false) {
22 22
 		$output = '';
23 23
 
24
-		if($text){
24
+		if ($text) {
25 25
 			$is_multiple = $multiple ? '[]' : '';
26
-			$output = ' name="'.sanitize_html_class($text).$is_multiple.'" ';
26
+			$output = ' name="' . sanitize_html_class($text) . $is_multiple . '" ';
27 27
 		}
28 28
 
29 29
 		return $output;
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @return string The sanitized item.
38 38
 	 */
39
-	public static function id($text){
39
+	public static function id($text) {
40 40
 		$output = '';
41 41
 
42
-		if($text){
43
-			$output = ' id="'.sanitize_html_class($text).'" ';
42
+		if ($text) {
43
+			$output = ' id="' . sanitize_html_class($text) . '" ';
44 44
 		}
45 45
 
46 46
 		return $output;
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 	 *
54 54
 	 * @return string The sanitized item.
55 55
 	 */
56
-	public static function title($text){
56
+	public static function title($text) {
57 57
 		$output = '';
58 58
 
59
-		if($text){
60
-			$output = ' title="'.esc_attr($text).'" ';
59
+		if ($text) {
60
+			$output = ' title="' . esc_attr($text) . '" ';
61 61
 		}
62 62
 
63 63
 		return $output;
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return string The sanitized item.
72 72
 	 */
73
-	public static function value($text){
73
+	public static function value($text) {
74 74
 		$output = '';
75 75
 
76
-		if($text){
77
-			$output = ' value="'.sanitize_text_field($text).'" ';
76
+		if ($text) {
77
+			$output = ' value="' . sanitize_text_field($text) . '" ';
78 78
 		}
79 79
 
80 80
 		return $output;
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return string The sanitized item.
89 89
 	 */
90
-	public static function class_attr($text){
90
+	public static function class_attr($text) {
91 91
 		$output = '';
92 92
 
93
-		if($text){
93
+		if ($text) {
94 94
 			$classes = self::esc_classes($text);
95
-			if(!empty($classes)){
96
-				$output = ' class="'.$classes.'" ';
95
+			if (!empty($classes)) {
96
+				$output = ' class="' . $classes . '" ';
97 97
 			}
98 98
 		}
99 99
 
@@ -107,15 +107,15 @@  discard block
 block discarded – undo
107 107
 	 *
108 108
 	 * @return string
109 109
 	 */
110
-	public static function esc_classes($text){
110
+	public static function esc_classes($text) {
111 111
 		$output = '';
112 112
 
113
-		if($text){
114
-			$classes = explode(" ",$text);
115
-			$classes = array_map("trim",$classes);
116
-			$classes = array_map("sanitize_html_class",$classes);
117
-			if(!empty($classes)){
118
-				$output = implode(" ",$classes);
113
+		if ($text) {
114
+			$classes = explode(" ", $text);
115
+			$classes = array_map("trim", $classes);
116
+			$classes = array_map("sanitize_html_class", $classes);
117
+			if (!empty($classes)) {
118
+				$output = implode(" ", $classes);
119 119
 			}
120 120
 		}
121 121
 
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @return string
130 130
 	 */
131
-	public static function data_attributes($args){
131
+	public static function data_attributes($args) {
132 132
 		$output = '';
133 133
 
134
-		if(!empty($args)){
134
+		if (!empty($args)) {
135 135
 
136
-			foreach($args as $key => $val){
137
-				if(substr( $key, 0, 5 ) === "data-"){
138
-					$output .= ' '.sanitize_html_class($key).'="'.esc_attr($val).'" ';
136
+			foreach ($args as $key => $val) {
137
+				if (substr($key, 0, 5) === "data-") {
138
+					$output .= ' ' . sanitize_html_class($key) . '="' . esc_attr($val) . '" ';
139 139
 				}
140 140
 			}
141 141
 		}
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
 	 *
149 149
 	 * @return string
150 150
 	 */
151
-	public static function aria_attributes($args){
151
+	public static function aria_attributes($args) {
152 152
 		$output = '';
153 153
 
154
-		if(!empty($args)){
154
+		if (!empty($args)) {
155 155
 
156
-			foreach($args as $key => $val){
157
-				if(substr( $key, 0, 5 ) === "aria-"){
158
-					$output .= ' '.sanitize_html_class($key).'="'.esc_attr($val).'" ';
156
+			foreach ($args as $key => $val) {
157
+				if (substr($key, 0, 5) === "aria-") {
158
+					$output .= ' ' . sanitize_html_class($key) . '="' . esc_attr($val) . '" ';
159 159
 				}
160 160
 			}
161 161
 		}
@@ -171,14 +171,14 @@  discard block
 block discarded – undo
171 171
 	 *
172 172
 	 * @return string
173 173
 	 */
174
-	public static function icon($class,$space_after = false){
174
+	public static function icon($class, $space_after = false) {
175 175
 		$output = '';
176 176
 
177
-		if($class){
177
+		if ($class) {
178 178
 			$classes = self::esc_classes($class);
179
-			if(!empty($classes)){
180
-				$output = '<i class="'.$classes.'" ></i>';
181
-				if($space_after){
179
+			if (!empty($classes)) {
180
+				$output = '<i class="' . $classes . '" ></i>';
181
+				if ($space_after) {
182 182
 					$output .= " ";
183 183
 				}
184 184
 			}
@@ -192,13 +192,13 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @return string
194 194
 	 */
195
-	public static function extra_attributes($args){
195
+	public static function extra_attributes($args) {
196 196
 		$output = '';
197 197
 
198
-		if(!empty($args) && is_array($args) ){
198
+		if (!empty($args) && is_array($args)) {
199 199
 
200
-			foreach($args as $key => $val){
201
-				$output .= ' '.sanitize_html_class($key).'="'.esc_attr($val).'" ';
200
+			foreach ($args as $key => $val) {
201
+				$output .= ' ' . sanitize_html_class($key) . '="' . esc_attr($val) . '" ';
202 202
 			}
203 203
 		}
204 204
 
Please login to merge, or discard this patch.
ayecode/wp-ayecode-ui/includes/components/class-aui-component-alert.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string The rendered component.
20 20
 	 */
21
-	public static function get($args = array()){
21
+	public static function get($args = array()) {
22 22
 		$defaults = array(
23 23
 			'type'       => 'info',
24 24
 			'class'      => '',
@@ -33,50 +33,50 @@  discard block
 block discarded – undo
33 33
 		/**
34 34
 		 * Parse incoming $args into an array and merge it with $defaults
35 35
 		 */
36
-		$args   = wp_parse_args( $args, $defaults );
36
+		$args   = wp_parse_args($args, $defaults);
37 37
 		$output = '';
38
-		if ( ! empty( $args['content'] ) ) {
39
-			$type = sanitize_html_class( $args['type'] );
40
-			if($type=='error'){$type='danger';}
41
-			$icon = !empty($args['icon']) ? "<i class='".esc_attr($args['icon'])."'></i>" : '';
38
+		if (!empty($args['content'])) {
39
+			$type = sanitize_html_class($args['type']);
40
+			if ($type == 'error') {$type = 'danger'; }
41
+			$icon = !empty($args['icon']) ? "<i class='" . esc_attr($args['icon']) . "'></i>" : '';
42 42
 
43 43
 			// set default icon
44
-			if(!$icon && $args['icon']!==false && $type){
45
-				if($type=='danger'){$icon = '<i class="fas fa-exclamation-circle"></i>';}
46
-				elseif($type=='warning'){$icon = '<i class="fas fa-exclamation-triangle"></i>';}
47
-				elseif($type=='success'){$icon = '<i class="fas fa-check-circle"></i>';}
48
-				elseif($type=='info'){$icon = '<i class="fas fa-info-circle"></i>';}
44
+			if (!$icon && $args['icon'] !== false && $type) {
45
+				if ($type == 'danger') {$icon = '<i class="fas fa-exclamation-circle"></i>'; }
46
+				elseif ($type == 'warning') {$icon = '<i class="fas fa-exclamation-triangle"></i>'; }
47
+				elseif ($type == 'success') {$icon = '<i class="fas fa-check-circle"></i>'; }
48
+				elseif ($type == 'info') {$icon = '<i class="fas fa-info-circle"></i>'; }
49 49
 			}
50 50
 
51 51
 			$data = '';
52 52
 			$class = !empty($args['class']) ? esc_attr($args['class']) : '';
53
-			if($args['dismissible']){$class .= " alert-dismissible fade show";}
53
+			if ($args['dismissible']) {$class .= " alert-dismissible fade show"; }
54 54
 
55 55
 			// open
56
-			$output .= '<div class="alert alert-' . $type . ' '.$class.'" role="alert" '.$data.'>';
56
+			$output .= '<div class="alert alert-' . $type . ' ' . $class . '" role="alert" ' . $data . '>';
57 57
 
58 58
 			// heading
59
-			if ( ! empty( $args['heading'] ) ) {
59
+			if (!empty($args['heading'])) {
60 60
 				$output .= '<h4 class="alert-heading">' . $args['heading'] . '</h4>';
61 61
 			}
62 62
 
63 63
 			// icon
64
-			if ( ! empty( $icon) ) {
65
-				$output .= $icon." ";
64
+			if (!empty($icon)) {
65
+				$output .= $icon . " ";
66 66
 			}
67 67
 
68 68
 			// content
69 69
 			$output .= $args['content'];
70 70
 
71 71
 			// dismissible
72
-			if($args['dismissible']){
72
+			if ($args['dismissible']) {
73 73
 				$output .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close">';
74 74
 				$output .= '<span aria-hidden="true">&times;</span>';
75 75
 				$output .= '</button>';
76 76
 			}
77 77
 
78 78
 			// footer
79
-			if ( ! empty( $args['footer'] ) ) {
79
+			if (!empty($args['footer'])) {
80 80
 				$output .= '<hr>';
81 81
 				$output .= '<p class="mb-0">' . $args['footer'] . '</p>';
82 82
 			}
Please login to merge, or discard this patch.
ayecode/wp-ayecode-ui/includes/components/class-aui-component-dropdown.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string The rendered component.
20 20
 	 */
21
-	public static function get($args = array()){
21
+	public static function get($args = array()) {
22 22
 		$defaults = array(
23 23
 			'type'       => 'button',
24 24
 			'href'       => '#',
@@ -43,20 +43,20 @@  discard block
 block discarded – undo
43 43
 		/**
44 44
 		 * Parse incoming $args into an array and merge it with $defaults
45 45
 		 */
46
-		$args   = wp_parse_args( $args, $defaults );
46
+		$args   = wp_parse_args($args, $defaults);
47 47
 		$output = '';
48
-		if ( ! empty( $args['type'] ) ) {
48
+		if (!empty($args['type'])) {
49 49
 			// wrapper open
50
-			$output .= '<div class="dropdown '.AUI_Component_Helper::esc_classes($args['wrapper_class']).'">';
50
+			$output .= '<div class="dropdown ' . AUI_Component_Helper::esc_classes($args['wrapper_class']) . '">';
51 51
 
52 52
 			// button part
53 53
 			$output .= aui()->button($args);
54 54
 
55 55
 			// dropdown-menu
56
-			if(!empty($args['dropdown_menu'])){
56
+			if (!empty($args['dropdown_menu'])) {
57 57
 				$output .= $args['dropdown_menu'];
58
-			}elseif(!empty($args['dropdown_items'])){
59
-				$output .= '<div class="dropdown-menu '.AUI_Component_Helper::esc_classes($args['dropdown_menu_class']).'" aria-labelledby="'.sanitize_html_class($args['id']).'">';
58
+			}elseif (!empty($args['dropdown_items'])) {
59
+				$output .= '<div class="dropdown-menu ' . AUI_Component_Helper::esc_classes($args['dropdown_menu_class']) . '" aria-labelledby="' . sanitize_html_class($args['id']) . '">';
60 60
 				$output .= aui()->render($args['dropdown_items']);
61 61
 				$output .= '</div>';
62 62
 			}
Please login to merge, or discard this patch.
wp-ayecode-ui/includes/components/class-aui-component-pagination.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -18,61 +18,61 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @return string The rendered component.
20 20
 	 */
21
-	public static function get( $args = array() ) {
21
+	public static function get($args = array()) {
22 22
 		global $wp_query;
23 23
 
24 24
 		$defaults = array(
25 25
 			'mid_size'           => 2,
26 26
 			'prev_text'          => '<i class="fas fa-chevron-left"></i>',
27 27
 			'next_text'          => '<i class="fas fa-chevron-right"></i>',
28
-			'screen_reader_text' => __( 'Posts navigation' ),
28
+			'screen_reader_text' => __('Posts navigation'),
29 29
 			'before_page_number' => '',
30 30
 			'after_page_number'  => '',
31 31
 			'type'               => 'array',
32
-			'total'              => isset( $wp_query->max_num_pages ) ? $wp_query->max_num_pages : 1
32
+			'total'              => isset($wp_query->max_num_pages) ? $wp_query->max_num_pages : 1
33 33
 		);
34 34
 
35 35
 		/**
36 36
 		 * Parse incoming $args into an array and merge it with $defaults
37 37
 		 */
38
-		$args = wp_parse_args( $args, $defaults );
38
+		$args = wp_parse_args($args, $defaults);
39 39
 
40 40
 		$output = '';
41 41
 
42 42
 		// Don't print empty markup if there's only one page.
43
-		if ( $args['total'] > 1 ) {
43
+		if ($args['total'] > 1) {
44 44
 
45 45
 			// Set up paginated links.
46
-			$links = paginate_links( $args );
46
+			$links = paginate_links($args);
47 47
 
48 48
 			// make the output bootstrap ready
49 49
 			$links_html = "<ul class='pagination m-0 p-0'>";
50
-			if ( ! empty( $links ) ) {
51
-				foreach ( $links as $link ) {
52
-					$active = strpos( $link, 'current' ) !== false ? 'active' : '';
50
+			if (!empty($links)) {
51
+				foreach ($links as $link) {
52
+					$active = strpos($link, 'current') !== false ? 'active' : '';
53 53
 					$links_html .= "<li class='page-item $active'>";
54
-					$links_html .= str_replace( "page-numbers", "page-link", $link );
54
+					$links_html .= str_replace("page-numbers", "page-link", $link);
55 55
 					$links_html .= "</li>";
56 56
 				}
57 57
 			}
58 58
 			$links_html .= "</ul>";
59 59
 
60
-			if ( $links ) {
60
+			if ($links) {
61 61
 				$output .= '<section class="px-0 py-2 w-100">';
62
-				$output .= _navigation_markup( $links_html, 'aui-pagination', $args['screen_reader_text'] );
62
+				$output .= _navigation_markup($links_html, 'aui-pagination', $args['screen_reader_text']);
63 63
 				$output .= '</section>';
64 64
 			}
65 65
 
66
-			$output = str_replace( "screen-reader-text", "screen-reader-text sr-only", $output );
67
-			$output = str_replace( "nav-links", "aui-nav-links", $output );
66
+			$output = str_replace("screen-reader-text", "screen-reader-text sr-only", $output);
67
+			$output = str_replace("nav-links", "aui-nav-links", $output);
68 68
 		}
69 69
 
70
-		if ( $output ) {
71
-			if ( ! empty( $args['before_paging'] ) ) {
70
+		if ($output) {
71
+			if (!empty($args['before_paging'])) {
72 72
 				$output = $args['before_paging'] . $output;
73 73
 			}
74 74
 
75
-			if ( ! empty( $args['after_paging'] ) ) {
75
+			if (!empty($args['after_paging'])) {
76 76
 				$output = $output . $args['after_paging'];
77 77
 			}
78 78
 		}
Please login to merge, or discard this patch.
vendor/ayecode/wp-ayecode-ui/includes/ayecode-ui-settings.php 1 patch
Spacing   +218 added lines, -218 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 /**
13 13
  * Bail if we are not in WP.
14 14
  */
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if (!defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
19 19
 /**
20 20
  * Only add if the class does not already exist.
21 21
  */
22
-if ( ! class_exists( 'AyeCode_UI_Settings' ) ) {
22
+if (!class_exists('AyeCode_UI_Settings')) {
23 23
 
24 24
 	/**
25 25
 	 * A Class to be able to change settings for Font Awesome.
@@ -98,22 +98,22 @@  discard block
 block discarded – undo
98 98
 		 * @return AyeCode_UI_Settings - Main instance.
99 99
 		 */
100 100
 		public static function instance() {
101
-			if ( ! isset( self::$instance ) && ! ( self::$instance instanceof AyeCode_UI_Settings ) ) {
101
+			if (!isset(self::$instance) && !(self::$instance instanceof AyeCode_UI_Settings)) {
102 102
 				self::$instance = new AyeCode_UI_Settings;
103 103
 
104
-				add_action( 'init', array( self::$instance, 'init' ) ); // set settings
104
+				add_action('init', array(self::$instance, 'init')); // set settings
105 105
 
106
-				if ( is_admin() ) {
107
-					add_action( 'admin_menu', array( self::$instance, 'menu_item' ) );
108
-					add_action( 'admin_init', array( self::$instance, 'register_settings' ) );
106
+				if (is_admin()) {
107
+					add_action('admin_menu', array(self::$instance, 'menu_item'));
108
+					add_action('admin_init', array(self::$instance, 'register_settings'));
109 109
 
110 110
 					// Maybe show example page
111
-					add_action( 'template_redirect', array( self::$instance,'maybe_show_examples' ) );
111
+					add_action('template_redirect', array(self::$instance, 'maybe_show_examples'));
112 112
 				}
113 113
 
114
-				add_action( 'customize_register', array( self::$instance, 'customizer_settings' ));
114
+				add_action('customize_register', array(self::$instance, 'customizer_settings'));
115 115
 
116
-				do_action( 'ayecode_ui_settings_loaded' );
116
+				do_action('ayecode_ui_settings_loaded');
117 117
 			}
118 118
 
119 119
 			return self::$instance;
@@ -131,24 +131,24 @@  discard block
 block discarded – undo
131 131
 			 *
132 132
 			 * We load super early in case there is a theme version that might change the colors
133 133
 			 */
134
-			if ( $this->settings['css'] ) {
135
-				add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ), 1 );
134
+			if ($this->settings['css']) {
135
+				add_action('wp_enqueue_scripts', array($this, 'enqueue_style'), 1);
136 136
 			}
137
-			if ( $this->settings['css_backend'] ) {
138
-				add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_style' ), 1 );
137
+			if ($this->settings['css_backend']) {
138
+				add_action('admin_enqueue_scripts', array($this, 'enqueue_style'), 1);
139 139
 			}
140 140
 
141 141
 			// maybe load JS
142
-			if ( $this->settings['js'] ) {
143
-				add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 1 );
142
+			if ($this->settings['js']) {
143
+				add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'), 1);
144 144
 			}
145
-			if ( $this->settings['js_backend'] ) {
146
-				add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 1 );
145
+			if ($this->settings['js_backend']) {
146
+				add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'), 1);
147 147
 			}
148 148
 
149 149
 			// Maybe set the HTML font size
150
-			if ( $this->settings['html_font_size'] ) {
151
-				add_action( 'wp_footer', array( $this, 'html_font_size' ), 10 );
150
+			if ($this->settings['html_font_size']) {
151
+				add_action('wp_footer', array($this, 'html_font_size'), 10);
152 152
 			}
153 153
 
154 154
 
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 		/**
158 158
 		 * Add a html font size to the footer.
159 159
 		 */
160
-		public function html_font_size(){
160
+		public function html_font_size() {
161 161
 			$this->settings = $this->get_settings();
162
-			echo "<style>html{font-size:".absint($this->settings['html_font_size'])."px;}</style>";
162
+			echo "<style>html{font-size:" . absint($this->settings['html_font_size']) . "px;}</style>";
163 163
 		}
164 164
 
165 165
 		/**
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
 			
170 170
 			$css_setting = current_action() == 'wp_enqueue_scripts' ? 'css' : 'css_backend';
171 171
 
172
-			if($this->settings[$css_setting]){
173
-				$compatibility = $this->settings[$css_setting]=='core' ? false : true;
174
-				$url = $this->settings[$css_setting]=='core' ? $this->url.'assets/css/ayecode-ui.css' : $this->url.'assets/css/ayecode-ui-compatibility.css';
175
-				wp_register_style( 'ayecode-ui', $url, array(), $this->latest );
176
-				wp_enqueue_style( 'ayecode-ui' );
172
+			if ($this->settings[$css_setting]) {
173
+				$compatibility = $this->settings[$css_setting] == 'core' ? false : true;
174
+				$url = $this->settings[$css_setting] == 'core' ? $this->url . 'assets/css/ayecode-ui.css' : $this->url . 'assets/css/ayecode-ui-compatibility.css';
175
+				wp_register_style('ayecode-ui', $url, array(), $this->latest);
176
+				wp_enqueue_style('ayecode-ui');
177 177
 
178 178
 
179 179
 				// fix some wp-admin issues
180
-				if(is_admin()){
180
+				if (is_admin()) {
181 181
 					$custom_css = "
182 182
                 body{
183 183
                     background-color: #f1f1f1;
@@ -213,11 +213,11 @@  discard block
 block discarded – undo
213 213
 				    margin: 1em 0
214 214
 				}
215 215
                 ";
216
-					wp_add_inline_style( 'ayecode-ui', $custom_css );
216
+					wp_add_inline_style('ayecode-ui', $custom_css);
217 217
 				}
218 218
 
219 219
 				// custom changes
220
-				wp_add_inline_style( 'ayecode-ui', self::custom_css($compatibility) );
220
+				wp_add_inline_style('ayecode-ui', self::custom_css($compatibility));
221 221
 
222 222
 			}
223 223
 		}
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		 *
228 228
 		 * If this remains small then its best to use this than to add another JS file.
229 229
 		 */
230
-		public function inline_script(){
230
+		public function inline_script() {
231 231
 			ob_start();
232 232
 			?>
233 233
 			<script>
@@ -418,10 +418,10 @@  discard block
 block discarded – undo
418 418
 			/*
419 419
 			 * We only add the <script> tags for code highlighting, so we strip them from the output.
420 420
 			 */
421
-			return str_replace( array(
421
+			return str_replace(array(
422 422
 				'<script>',
423 423
 				'</script>'
424
-			), '', $output );
424
+			), '', $output);
425 425
 		}
426 426
 
427 427
 		/**
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		 *
430 430
 		 * If this remains small then its best to use this than to add another JS file.
431 431
 		 */
432
-		public function inline_script_file_browser(){
432
+		public function inline_script_file_browser() {
433 433
 			ob_start();
434 434
 			?>
435 435
 			<script>
@@ -444,10 +444,10 @@  discard block
 block discarded – undo
444 444
 			/*
445 445
 			 * We only add the <script> tags for code highlighting, so we strip them from the output.
446 446
 			 */
447
-			return str_replace( array(
447
+			return str_replace(array(
448 448
 				'<script>',
449 449
 				'</script>'
450
-			), '', $output );
450
+			), '', $output);
451 451
 		}
452 452
 
453 453
 		/**
@@ -458,36 +458,36 @@  discard block
 block discarded – undo
458 458
 			$js_setting = current_action() == 'wp_enqueue_scripts' ? 'js' : 'js_backend';
459 459
 			
460 460
 			// select2
461
-			wp_register_script( 'select2', $this->url.'assets/js/select2.min.js', array('jquery'), $this->select2_version );
461
+			wp_register_script('select2', $this->url . 'assets/js/select2.min.js', array('jquery'), $this->select2_version);
462 462
 
463 463
 			// Bootstrap file browser
464
-			wp_register_script( 'aui-custom-file-input', $url = $this->url.'assets/js/bs-custom-file-input.min.js', array('jquery'), $this->select2_version );
465
-			wp_add_inline_script( 'aui-custom-file-input', $this->inline_script_file_browser() );
464
+			wp_register_script('aui-custom-file-input', $url = $this->url . 'assets/js/bs-custom-file-input.min.js', array('jquery'), $this->select2_version);
465
+			wp_add_inline_script('aui-custom-file-input', $this->inline_script_file_browser());
466 466
 
467 467
 			$load_inline = false;
468 468
 
469
-			if($this->settings[$js_setting]=='core-popper'){
469
+			if ($this->settings[$js_setting] == 'core-popper') {
470 470
 				// Bootstrap bundle
471
-				$url = $this->url.'assets/js/bootstrap.bundle.min.js';
472
-				wp_register_script( 'bootstrap-js-bundle', $url, array('select2','jquery'), $this->latest );
473
-				wp_enqueue_script( 'bootstrap-js-bundle' );
471
+				$url = $this->url . 'assets/js/bootstrap.bundle.min.js';
472
+				wp_register_script('bootstrap-js-bundle', $url, array('select2', 'jquery'), $this->latest);
473
+				wp_enqueue_script('bootstrap-js-bundle');
474 474
 				$script = $this->inline_script();
475
-				wp_add_inline_script( 'bootstrap-js-bundle', $script );
476
-			}elseif($this->settings[$js_setting]=='popper'){
477
-				$url = $this->url.'assets/js/popper.min.js';
478
-				wp_register_script( 'bootstrap-js-popper', $url, array('jquery'), $this->latest );
479
-				wp_enqueue_script( 'bootstrap-js-popper' );
475
+				wp_add_inline_script('bootstrap-js-bundle', $script);
476
+			}elseif ($this->settings[$js_setting] == 'popper') {
477
+				$url = $this->url . 'assets/js/popper.min.js';
478
+				wp_register_script('bootstrap-js-popper', $url, array('jquery'), $this->latest);
479
+				wp_enqueue_script('bootstrap-js-popper');
480 480
 				$load_inline = true;
481
-			}else{
481
+			} else {
482 482
 				$load_inline = true;
483 483
 			}
484 484
 
485 485
 			// Load needed inline scripts by faking the loading of a script if the main script is not being loaded
486
-			if($load_inline){
487
-				wp_register_script( 'bootstrap-dummy', '',array('jquery') );
488
-				wp_enqueue_script( 'bootstrap-dummy' );
486
+			if ($load_inline) {
487
+				wp_register_script('bootstrap-dummy', '', array('jquery'));
488
+				wp_enqueue_script('bootstrap-dummy');
489 489
 				$script = $this->inline_script();
490
-				wp_add_inline_script( 'bootstrap-dummy', $script  );
490
+				wp_add_inline_script('bootstrap-dummy', $script);
491 491
 			}
492 492
 			
493 493
 		}
@@ -501,15 +501,15 @@  discard block
 block discarded – undo
501 501
 
502 502
 			$url = '';
503 503
 			// check if we are inside a plugin
504
-			$file_dir = str_replace( "/includes","", wp_normalize_path( dirname( __FILE__ ) ) );
504
+			$file_dir = str_replace("/includes", "", wp_normalize_path(dirname(__FILE__)));
505 505
 
506 506
 			// add check in-case user has changed wp-content dir name.
507 507
 			$wp_content_folder_name = basename(WP_CONTENT_DIR);
508
-			$dir_parts = explode("/$wp_content_folder_name/",$file_dir);
509
-			$url_parts = explode("/$wp_content_folder_name/",plugins_url());
508
+			$dir_parts = explode("/$wp_content_folder_name/", $file_dir);
509
+			$url_parts = explode("/$wp_content_folder_name/", plugins_url());
510 510
 
511
-			if(!empty($url_parts[0]) && !empty($dir_parts[1])){
512
-				$url = trailingslashit( $url_parts[0]."/$wp_content_folder_name/".$dir_parts[1] );
511
+			if (!empty($url_parts[0]) && !empty($dir_parts[1])) {
512
+				$url = trailingslashit($url_parts[0] . "/$wp_content_folder_name/" . $dir_parts[1]);
513 513
 			}
514 514
 
515 515
 			return $url;
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 		 * Register the database settings with WordPress.
520 520
 		 */
521 521
 		public function register_settings() {
522
-			register_setting( 'ayecode-ui-settings', 'ayecode-ui-settings' );
522
+			register_setting('ayecode-ui-settings', 'ayecode-ui-settings');
523 523
 		}
524 524
 
525 525
 		/**
@@ -528,10 +528,10 @@  discard block
 block discarded – undo
528 528
 		 */
529 529
 		public function menu_item() {
530 530
 			$menu_function = 'add' . '_' . 'options' . '_' . 'page'; // won't pass theme check if function name present in theme
531
-			call_user_func( $menu_function, $this->name, $this->name, 'manage_options', 'ayecode-ui-settings', array(
531
+			call_user_func($menu_function, $this->name, $this->name, 'manage_options', 'ayecode-ui-settings', array(
532 532
 				$this,
533 533
 				'settings_page'
534
-			) );
534
+			));
535 535
 		}
536 536
 
537 537
 		/**
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 		 * 
540 540
 		 * @return array
541 541
 		 */
542
-		public function theme_js_settings(){
542
+		public function theme_js_settings() {
543 543
 			return array(
544 544
 				'ayetheme' => 'popper',
545 545
 				'listimia' => 'required',
@@ -555,17 +555,17 @@  discard block
 block discarded – undo
555 555
 		 */
556 556
 		public function get_settings() {
557 557
 
558
-			$db_settings = get_option( 'ayecode-ui-settings' );
558
+			$db_settings = get_option('ayecode-ui-settings');
559 559
 			$js_default = 'core-popper';
560 560
 			$js_default_backend = $js_default;
561 561
 
562 562
 			// maybe set defaults (if no settings set)
563
-			if(empty($db_settings)){
564
-				$active_theme = strtolower( get_template() ); // active parent theme.
563
+			if (empty($db_settings)) {
564
+				$active_theme = strtolower(get_template()); // active parent theme.
565 565
 				$theme_js_settings = self::theme_js_settings();
566
-				if(isset($theme_js_settings[$active_theme])){
566
+				if (isset($theme_js_settings[$active_theme])) {
567 567
 					$js_default = $theme_js_settings[$active_theme];
568
-					$js_default_backend = isset($theme_js_settings[$active_theme."_backend"]) ? $theme_js_settings[$active_theme."_backend"] : $js_default;
568
+					$js_default_backend = isset($theme_js_settings[$active_theme . "_backend"]) ? $theme_js_settings[$active_theme . "_backend"] : $js_default;
569 569
 				}
570 570
 			}
571 571
 
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
 
579 579
 			);
580 580
 
581
-			$settings = wp_parse_args( $db_settings, $defaults );
581
+			$settings = wp_parse_args($db_settings, $defaults);
582 582
 
583 583
 			/**
584 584
 			 * Filter the Bootstrap settings.
585 585
 			 *
586 586
 			 * @todo if we add this filer people might use it and then it defeates the purpose of this class :/
587 587
 			 */
588
-			return $this->settings = apply_filters( 'ayecode-ui-settings', $settings, $db_settings, $defaults );
588
+			return $this->settings = apply_filters('ayecode-ui-settings', $settings, $db_settings, $defaults);
589 589
 		}
590 590
 
591 591
 
@@ -593,80 +593,80 @@  discard block
 block discarded – undo
593 593
 		 * The settings page html output.
594 594
 		 */
595 595
 		public function settings_page() {
596
-			if ( ! current_user_can( 'manage_options' ) ) {
597
-				wp_die( __( 'You do not have sufficient permissions to access this page.', 'aui' ) );
596
+			if (!current_user_can('manage_options')) {
597
+				wp_die(__('You do not have sufficient permissions to access this page.', 'aui'));
598 598
 			}
599 599
 			?>
600 600
 			<div class="wrap">
601 601
 				<h1><?php echo $this->name; ?></h1>
602
-				<p><?php _e("Here you can adjust settings if you are having compatibility issues.","aui");?></p>
602
+				<p><?php _e("Here you can adjust settings if you are having compatibility issues.", "aui"); ?></p>
603 603
 				<form method="post" action="options.php">
604 604
 					<?php
605
-					settings_fields( 'ayecode-ui-settings' );
606
-					do_settings_sections( 'ayecode-ui-settings' );
605
+					settings_fields('ayecode-ui-settings');
606
+					do_settings_sections('ayecode-ui-settings');
607 607
 					?>
608 608
 
609
-					<h2><?php _e( 'Frontend', 'aui' ); ?></h2>
609
+					<h2><?php _e('Frontend', 'aui'); ?></h2>
610 610
 					<table class="form-table wpbs-table-settings">
611 611
 						<tr valign="top">
612 612
 							<th scope="row"><label
613
-									for="wpbs-css"><?php _e( 'Load CSS', 'aui' ); ?></label></th>
613
+									for="wpbs-css"><?php _e('Load CSS', 'aui'); ?></label></th>
614 614
 							<td>
615 615
 								<select name="ayecode-ui-settings[css]" id="wpbs-css">
616
-									<option	value="compatibility" <?php selected( $this->settings['css'], 'compatibility' ); ?>><?php _e( 'Compatibility Mode', 'aui' ); ?></option>
617
-									<option value="core" <?php selected( $this->settings['css'], 'core' ); ?>><?php _e( 'Full Mode', 'aui' ); ?></option>
618
-									<option	value="" <?php selected( $this->settings['css'], '' ); ?>><?php _e( 'Disabled', 'aui' ); ?></option>
616
+									<option	value="compatibility" <?php selected($this->settings['css'], 'compatibility'); ?>><?php _e('Compatibility Mode', 'aui'); ?></option>
617
+									<option value="core" <?php selected($this->settings['css'], 'core'); ?>><?php _e('Full Mode', 'aui'); ?></option>
618
+									<option	value="" <?php selected($this->settings['css'], ''); ?>><?php _e('Disabled', 'aui'); ?></option>
619 619
 								</select>
620 620
 							</td>
621 621
 						</tr>
622 622
 
623 623
 						<tr valign="top">
624 624
 							<th scope="row"><label
625
-									for="wpbs-js"><?php _e( 'Load JS', 'aui' ); ?></label></th>
625
+									for="wpbs-js"><?php _e('Load JS', 'aui'); ?></label></th>
626 626
 							<td>
627 627
 								<select name="ayecode-ui-settings[js]" id="wpbs-js">
628
-									<option	value="core-popper" <?php selected( $this->settings['js'], 'core-popper' ); ?>><?php _e( 'Core + Popper (default)', 'aui' ); ?></option>
629
-									<option value="popper" <?php selected( $this->settings['js'], 'popper' ); ?>><?php _e( 'Popper', 'aui' ); ?></option>
630
-									<option value="required" <?php selected( $this->settings['js'], 'required' ); ?>><?php _e( 'Required functions only', 'aui' ); ?></option>
631
-									<option	value="" <?php selected( $this->settings['js'], '' ); ?>><?php _e( 'Disabled (not recommended)', 'aui' ); ?></option>
628
+									<option	value="core-popper" <?php selected($this->settings['js'], 'core-popper'); ?>><?php _e('Core + Popper (default)', 'aui'); ?></option>
629
+									<option value="popper" <?php selected($this->settings['js'], 'popper'); ?>><?php _e('Popper', 'aui'); ?></option>
630
+									<option value="required" <?php selected($this->settings['js'], 'required'); ?>><?php _e('Required functions only', 'aui'); ?></option>
631
+									<option	value="" <?php selected($this->settings['js'], ''); ?>><?php _e('Disabled (not recommended)', 'aui'); ?></option>
632 632
 								</select>
633 633
 							</td>
634 634
 						</tr>
635 635
 
636 636
 						<tr valign="top">
637 637
 							<th scope="row"><label
638
-									for="wpbs-font_size"><?php _e( 'HTML Font Size (px)', 'aui' ); ?></label></th>
638
+									for="wpbs-font_size"><?php _e('HTML Font Size (px)', 'aui'); ?></label></th>
639 639
 							<td>
640
-								<input type="number" name="ayecode-ui-settings[html_font_size]" id="wpbs-font_size" value="<?php echo absint( $this->settings['html_font_size']); ?>" placeholder="16" />
641
-								<p class="description" ><?php _e("Our font sizing is rem (responsive based) here you can set the html font size in-case your theme is setting it too low.","aui");?></p>
640
+								<input type="number" name="ayecode-ui-settings[html_font_size]" id="wpbs-font_size" value="<?php echo absint($this->settings['html_font_size']); ?>" placeholder="16" />
641
+								<p class="description" ><?php _e("Our font sizing is rem (responsive based) here you can set the html font size in-case your theme is setting it too low.", "aui"); ?></p>
642 642
 							</td>
643 643
 						</tr>
644 644
 
645 645
 					</table>
646 646
 
647
-					<h2><?php _e( 'Backend', 'aui' ); ?> (wp-admin)</h2>
647
+					<h2><?php _e('Backend', 'aui'); ?> (wp-admin)</h2>
648 648
 					<table class="form-table wpbs-table-settings">
649 649
 						<tr valign="top">
650 650
 							<th scope="row"><label
651
-									for="wpbs-css"><?php _e( 'Load CSS', 'aui' ); ?></label></th>
651
+									for="wpbs-css"><?php _e('Load CSS', 'aui'); ?></label></th>
652 652
 							<td>
653 653
 								<select name="ayecode-ui-settings[css_backend]" id="wpbs-css">
654
-									<option	value="compatibility" <?php selected( $this->settings['css_backend'], 'compatibility' ); ?>><?php _e( 'Compatibility Mode', 'aui' ); ?></option>
655
-									<option value="core" <?php selected( $this->settings['css_backend'], 'core' ); ?>><?php _e( 'Full Mode', 'aui' ); ?></option>
656
-									<option	value="" <?php selected( $this->settings['css_backend'], '' ); ?>><?php _e( 'Disabled', 'aui' ); ?></option>
654
+									<option	value="compatibility" <?php selected($this->settings['css_backend'], 'compatibility'); ?>><?php _e('Compatibility Mode', 'aui'); ?></option>
655
+									<option value="core" <?php selected($this->settings['css_backend'], 'core'); ?>><?php _e('Full Mode', 'aui'); ?></option>
656
+									<option	value="" <?php selected($this->settings['css_backend'], ''); ?>><?php _e('Disabled', 'aui'); ?></option>
657 657
 								</select>
658 658
 							</td>
659 659
 						</tr>
660 660
 
661 661
 						<tr valign="top">
662 662
 							<th scope="row"><label
663
-									for="wpbs-js"><?php _e( 'Load JS', 'aui' ); ?></label></th>
663
+									for="wpbs-js"><?php _e('Load JS', 'aui'); ?></label></th>
664 664
 							<td>
665 665
 								<select name="ayecode-ui-settings[js_backend]" id="wpbs-js">
666
-									<option	value="core-popper" <?php selected( $this->settings['js_backend'], 'core-popper' ); ?>><?php _e( 'Core + Popper (default)', 'aui' ); ?></option>
667
-									<option value="popper" <?php selected( $this->settings['js_backend'], 'popper' ); ?>><?php _e( 'Popper', 'aui' ); ?></option>
668
-									<option value="required" <?php selected( $this->settings['js_backend'], 'required' ); ?>><?php _e( 'Required functions only', 'aui' ); ?></option>
669
-									<option	value="" <?php selected( $this->settings['js_backend'], '' ); ?>><?php _e( 'Disabled (not recommended)', 'aui' ); ?></option>
666
+									<option	value="core-popper" <?php selected($this->settings['js_backend'], 'core-popper'); ?>><?php _e('Core + Popper (default)', 'aui'); ?></option>
667
+									<option value="popper" <?php selected($this->settings['js_backend'], 'popper'); ?>><?php _e('Popper', 'aui'); ?></option>
668
+									<option value="required" <?php selected($this->settings['js_backend'], 'required'); ?>><?php _e('Required functions only', 'aui'); ?></option>
669
+									<option	value="" <?php selected($this->settings['js_backend'], ''); ?>><?php _e('Disabled (not recommended)', 'aui'); ?></option>
670 670
 								</select>
671 671
 							</td>
672 672
 						</tr>
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 			<?php
685 685
 		}
686 686
 
687
-		public function customizer_settings($wp_customize){
687
+		public function customizer_settings($wp_customize) {
688 688
 			$wp_customize->add_section('aui_settings', array(
689 689
 				'title'    => __('AyeCode UI'),
690 690
 				'priority' => 120,
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
 				'type'              => 'option',
701 701
 				'transport'         => 'refresh',
702 702
 			));
703
-			$wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'color_primary', array(
703
+			$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color_primary', array(
704 704
 				'label'    => __('Primary Color'),
705 705
 				'section'  => 'aui_settings',
706 706
 				'settings' => 'aui_options[color_primary]',
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 				'type'              => 'option',
714 714
 				'transport'         => 'refresh',
715 715
 			));
716
-			$wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'color_secondary', array(
716
+			$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'color_secondary', array(
717 717
 				'label'    => __('Secondary Color'),
718 718
 				'section'  => 'aui_settings',
719 719
 				'settings' => 'aui_options[color_secondary]',
@@ -728,12 +728,12 @@  discard block
 block discarded – undo
728 728
 			?>
729 729
 			<style>
730 730
 				<?php
731
-					if(!empty($settings['color_primary']) && $settings['color_primary'] != "#1e73be"){
732
-						echo self::css_primary($settings['color_primary'],$compatibility);
731
+					if (!empty($settings['color_primary']) && $settings['color_primary'] != "#1e73be") {
732
+						echo self::css_primary($settings['color_primary'], $compatibility);
733 733
 					}
734 734
 
735
-					if(!empty($settings['color_secondary']) && $settings['color_secondary'] != "#6c757d"){
736
-						echo self::css_secondary($settings['color_secondary'],$compatibility);
735
+					if (!empty($settings['color_secondary']) && $settings['color_secondary'] != "#6c757d") {
736
+						echo self::css_secondary($settings['color_secondary'], $compatibility);
737 737
 					}
738 738
                 ?>
739 739
 			</style>
@@ -743,50 +743,50 @@  discard block
 block discarded – undo
743 743
 			/*
744 744
 			 * We only add the <script> tags for code highlighting, so we strip them from the output.
745 745
 			 */
746
-			return str_replace( array(
746
+			return str_replace(array(
747 747
 				'<style>',
748 748
 				'</style>'
749 749
 			), '', ob_get_clean());
750 750
 		}
751 751
 
752
-		public static function css_primary($color_code,$compatibility){;
752
+		public static function css_primary($color_code, $compatibility) {;
753 753
 			$color_code = sanitize_hex_color($color_code);
754
-			if(!$color_code){return '';}
754
+			if (!$color_code) {return ''; }
755 755
 			/**
756 756
 			 * c = color, b = background color, o = border-color, f = fill
757 757
 			 */
758 758
 			$selectors = array(
759 759
 				'a' => array('c'),
760
-				'.btn-primary' => array('b','o'),
761
-				'.btn-primary.disabled' => array('b','o'),
762
-				'.btn-primary:disabled' => array('b','o'),
763
-				'.btn-outline-primary' => array('c','o'),
764
-				'.btn-outline-primary:hover' => array('b','o'),
765
-				'.btn-outline-primary:not(:disabled):not(.disabled).active' => array('b','o'),
766
-				'.btn-outline-primary:not(:disabled):not(.disabled):active' => array('b','o'),
767
-				'.show>.btn-outline-primary.dropdown-toggle' => array('b','o'),
760
+				'.btn-primary' => array('b', 'o'),
761
+				'.btn-primary.disabled' => array('b', 'o'),
762
+				'.btn-primary:disabled' => array('b', 'o'),
763
+				'.btn-outline-primary' => array('c', 'o'),
764
+				'.btn-outline-primary:hover' => array('b', 'o'),
765
+				'.btn-outline-primary:not(:disabled):not(.disabled).active' => array('b', 'o'),
766
+				'.btn-outline-primary:not(:disabled):not(.disabled):active' => array('b', 'o'),
767
+				'.show>.btn-outline-primary.dropdown-toggle' => array('b', 'o'),
768 768
 				'.btn-link' => array('c'),
769 769
 				'.dropdown-item.active' => array('b'),
770
-				'.custom-control-input:checked~.custom-control-label::before' => array('b','o'),
771
-				'.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before' => array('b','o'),
770
+				'.custom-control-input:checked~.custom-control-label::before' => array('b', 'o'),
771
+				'.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before' => array('b', 'o'),
772 772
 //				'.custom-range::-webkit-slider-thumb' => array('b'), // these break the inline rules...
773 773
 //				'.custom-range::-moz-range-thumb' => array('b'),
774 774
 //				'.custom-range::-ms-thumb' => array('b'),
775 775
 				'.nav-pills .nav-link.active' => array('b'),
776 776
 				'.nav-pills .show>.nav-link' => array('b'),
777 777
 				'.page-link' => array('c'),
778
-				'.page-item.active .page-link' => array('b','o'),
778
+				'.page-item.active .page-link' => array('b', 'o'),
779 779
 				'.badge-primary' => array('b'),
780
-				'.alert-primary' => array('b','o'),
780
+				'.alert-primary' => array('b', 'o'),
781 781
 				'.progress-bar' => array('b'),
782
-				'.list-group-item.active' => array('b','o'),
783
-				'.bg-primary' => array('b','f'),
782
+				'.list-group-item.active' => array('b', 'o'),
783
+				'.bg-primary' => array('b', 'f'),
784 784
 				'.btn-link.btn-primary' => array('c'),
785 785
 				'.select2-container .select2-results__option--highlighted.select2-results__option[aria-selected=true]' => array('b'),
786 786
 			);
787 787
 
788 788
 			$important_selectors = array(
789
-				'.bg-primary' => array('b','f'),
789
+				'.bg-primary' => array('b', 'f'),
790 790
 				'.border-primary' => array('o'),
791 791
 				'.text-primary' => array('c'),
792 792
 			);
@@ -803,116 +803,116 @@  discard block
 block discarded – undo
803 803
 			$output = '';
804 804
 
805 805
 			// build rules into each type
806
-			foreach($selectors as $selector => $types){
807
-				$selector = $compatibility ? ".bsui ".$selector : $selector;
808
-				$types = array_combine($types,$types);
809
-				if(isset($types['c'])){$color[] = $selector;}
810
-				if(isset($types['b'])){$background[] = $selector;}
811
-				if(isset($types['o'])){$border[] = $selector;}
812
-				if(isset($types['f'])){$fill[] = $selector;}
806
+			foreach ($selectors as $selector => $types) {
807
+				$selector = $compatibility ? ".bsui " . $selector : $selector;
808
+				$types = array_combine($types, $types);
809
+				if (isset($types['c'])) {$color[] = $selector; }
810
+				if (isset($types['b'])) {$background[] = $selector; }
811
+				if (isset($types['o'])) {$border[] = $selector; }
812
+				if (isset($types['f'])) {$fill[] = $selector; }
813 813
 			}
814 814
 
815 815
 			// build rules into each type
816
-			foreach($important_selectors as $selector => $types){
817
-				$selector = $compatibility ? ".bsui ".$selector : $selector;
818
-				$types = array_combine($types,$types);
819
-				if(isset($types['c'])){$color_i[] = $selector;}
820
-				if(isset($types['b'])){$background_i[] = $selector;}
821
-				if(isset($types['o'])){$border_i[] = $selector;}
822
-				if(isset($types['f'])){$fill_i[] = $selector;}
816
+			foreach ($important_selectors as $selector => $types) {
817
+				$selector = $compatibility ? ".bsui " . $selector : $selector;
818
+				$types = array_combine($types, $types);
819
+				if (isset($types['c'])) {$color_i[] = $selector; }
820
+				if (isset($types['b'])) {$background_i[] = $selector; }
821
+				if (isset($types['o'])) {$border_i[] = $selector; }
822
+				if (isset($types['f'])) {$fill_i[] = $selector; }
823 823
 			}
824 824
 
825 825
 			// add any color rules
826
-			if(!empty($color)){
827
-				$output .= implode(",",$color) . "{color: $color_code;} ";
826
+			if (!empty($color)) {
827
+				$output .= implode(",", $color) . "{color: $color_code;} ";
828 828
 			}
829
-			if(!empty($color_i)){
830
-				$output .= implode(",",$color_i) . "{color: $color_code !important;} ";
829
+			if (!empty($color_i)) {
830
+				$output .= implode(",", $color_i) . "{color: $color_code !important;} ";
831 831
 			}
832 832
 
833 833
 			// add any background color rules
834
-			if(!empty($background)){
835
-				$output .= implode(",",$background) . "{background-color: $color_code;} ";
834
+			if (!empty($background)) {
835
+				$output .= implode(",", $background) . "{background-color: $color_code;} ";
836 836
 			}
837
-			if(!empty($background_i)){
838
-				$output .= implode(",",$background_i) . "{background-color: $color_code !important;} ";
837
+			if (!empty($background_i)) {
838
+				$output .= implode(",", $background_i) . "{background-color: $color_code !important;} ";
839 839
 			}
840 840
 
841 841
 			// add any border color rules
842
-			if(!empty($border)){
843
-				$output .= implode(",",$border) . "{border-color: $color_code;} ";
842
+			if (!empty($border)) {
843
+				$output .= implode(",", $border) . "{border-color: $color_code;} ";
844 844
 			}
845
-			if(!empty($border_i)){
846
-				$output .= implode(",",$border_i) . "{border-color: $color_code !important;} ";
845
+			if (!empty($border_i)) {
846
+				$output .= implode(",", $border_i) . "{border-color: $color_code !important;} ";
847 847
 			}
848 848
 
849 849
 			// add any fill color rules
850
-			if(!empty($fill)){
851
-				$output .= implode(",",$fill) . "{fill: $color_code;} ";
850
+			if (!empty($fill)) {
851
+				$output .= implode(",", $fill) . "{fill: $color_code;} ";
852 852
 			}
853
-			if(!empty($fill_i)){
854
-				$output .= implode(",",$fill_i) . "{fill: $color_code !important;} ";
853
+			if (!empty($fill_i)) {
854
+				$output .= implode(",", $fill_i) . "{fill: $color_code !important;} ";
855 855
 			}
856 856
 
857 857
 
858 858
 			$prefix = $compatibility ? ".bsui " : "";
859 859
 
860 860
 			// darken
861
-			$darker_075 = self::css_hex_lighten_darken($color_code,"-0.075");
862
-			$darker_10 = self::css_hex_lighten_darken($color_code,"-0.10");
863
-			$darker_125 = self::css_hex_lighten_darken($color_code,"-0.125");
861
+			$darker_075 = self::css_hex_lighten_darken($color_code, "-0.075");
862
+			$darker_10 = self::css_hex_lighten_darken($color_code, "-0.10");
863
+			$darker_125 = self::css_hex_lighten_darken($color_code, "-0.125");
864 864
 
865 865
 			// lighten
866
-			$lighten_25 = self::css_hex_lighten_darken($color_code,"0.25");
866
+			$lighten_25 = self::css_hex_lighten_darken($color_code, "0.25");
867 867
 
868 868
 			// opacity see https://css-tricks.com/8-digit-hex-codes/
869
-			$op_25 = $color_code."40"; // 25% opacity
869
+			$op_25 = $color_code . "40"; // 25% opacity
870 870
 
871 871
 
872 872
 			// button states
873
-			$output .= $prefix ." .btn-primary:hover{background-color: ".$darker_075.";    border-color: ".$darker_10.";} ";
874
-			$output .= $prefix ." .btn-outline-primary:not(:disabled):not(.disabled):active:focus, $prefix .btn-outline-primary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-outline-primary.dropdown-toggle:focus{box-shadow: 0 0 0 0.2rem $op_25;} ";
875
-			$output .= $prefix ." .btn-primary:not(:disabled):not(.disabled):active, $prefix .btn-primary:not(:disabled):not(.disabled).active, .show>$prefix .btn-primary.dropdown-toggle{background-color: ".$darker_10.";    border-color: ".$darker_125.";} ";
876
-			$output .= $prefix ." .btn-primary:not(:disabled):not(.disabled):active:focus, $prefix .btn-primary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-primary.dropdown-toggle:focus {box-shadow: 0 0 0 0.2rem $op_25;} ";
873
+			$output .= $prefix . " .btn-primary:hover{background-color: " . $darker_075 . ";    border-color: " . $darker_10 . ";} ";
874
+			$output .= $prefix . " .btn-outline-primary:not(:disabled):not(.disabled):active:focus, $prefix .btn-outline-primary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-outline-primary.dropdown-toggle:focus{box-shadow: 0 0 0 0.2rem $op_25;} ";
875
+			$output .= $prefix . " .btn-primary:not(:disabled):not(.disabled):active, $prefix .btn-primary:not(:disabled):not(.disabled).active, .show>$prefix .btn-primary.dropdown-toggle{background-color: " . $darker_10 . ";    border-color: " . $darker_125 . ";} ";
876
+			$output .= $prefix . " .btn-primary:not(:disabled):not(.disabled):active:focus, $prefix .btn-primary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-primary.dropdown-toggle:focus {box-shadow: 0 0 0 0.2rem $op_25;} ";
877 877
 
878 878
 
879 879
 			// dropdown's
880
-			$output .= $prefix ." .dropdown-item.active, $prefix .dropdown-item:active{background-color: $color_code;} ";
880
+			$output .= $prefix . " .dropdown-item.active, $prefix .dropdown-item:active{background-color: $color_code;} ";
881 881
 
882 882
 
883 883
 			// input states
884
-			$output .= $prefix ." .form-control:focus{border-color: ".$lighten_25.";box-shadow: 0 0 0 0.2rem $op_25;} ";
884
+			$output .= $prefix . " .form-control:focus{border-color: " . $lighten_25 . ";box-shadow: 0 0 0 0.2rem $op_25;} ";
885 885
 
886 886
 			// page link
887
-			$output .= $prefix ." .page-link:focus{box-shadow: 0 0 0 0.2rem $op_25;} ";
887
+			$output .= $prefix . " .page-link:focus{box-shadow: 0 0 0 0.2rem $op_25;} ";
888 888
 
889 889
 			return $output;
890 890
 		}
891 891
 
892
-		public static function css_secondary($color_code,$compatibility){;
892
+		public static function css_secondary($color_code, $compatibility) {;
893 893
 			$color_code = sanitize_hex_color($color_code);
894
-			if(!$color_code){return '';}
894
+			if (!$color_code) {return ''; }
895 895
 			/**
896 896
 			 * c = color, b = background color, o = border-color, f = fill
897 897
 			 */
898 898
 			$selectors = array(
899
-				'.btn-secondary' => array('b','o'),
900
-				'.btn-secondary.disabled' => array('b','o'),
901
-				'.btn-secondary:disabled' => array('b','o'),
902
-				'.btn-outline-secondary' => array('c','o'),
903
-				'.btn-outline-secondary:hover' => array('b','o'),
899
+				'.btn-secondary' => array('b', 'o'),
900
+				'.btn-secondary.disabled' => array('b', 'o'),
901
+				'.btn-secondary:disabled' => array('b', 'o'),
902
+				'.btn-outline-secondary' => array('c', 'o'),
903
+				'.btn-outline-secondary:hover' => array('b', 'o'),
904 904
 				'.btn-outline-secondary.disabled' => array('c'),
905 905
 				'.btn-outline-secondary:disabled' => array('c'),
906
-				'.btn-outline-secondary:not(:disabled):not(.disabled):active' => array('b','o'),
907
-				'.btn-outline-secondary:not(:disabled):not(.disabled).active' => array('b','o'),
908
-				'.btn-outline-secondary.dropdown-toggle' => array('b','o'),
906
+				'.btn-outline-secondary:not(:disabled):not(.disabled):active' => array('b', 'o'),
907
+				'.btn-outline-secondary:not(:disabled):not(.disabled).active' => array('b', 'o'),
908
+				'.btn-outline-secondary.dropdown-toggle' => array('b', 'o'),
909 909
 				'.badge-secondary' => array('b'),
910
-				'.alert-secondary' => array('b','o'),
910
+				'.alert-secondary' => array('b', 'o'),
911 911
 				'.btn-link.btn-secondary' => array('c'),
912 912
 				);
913 913
 
914 914
 			$important_selectors = array(
915
-				'.bg-secondary' => array('b','f'),
915
+				'.bg-secondary' => array('b', 'f'),
916 916
 				'.border-secondary' => array('o'),
917 917
 				'.text-secondary' => array('c'),
918 918
 			);
@@ -929,77 +929,77 @@  discard block
 block discarded – undo
929 929
 			$output = '';
930 930
 
931 931
 			// build rules into each type
932
-			foreach($selectors as $selector => $types){
933
-				$selector = $compatibility ? ".bsui ".$selector : $selector;
934
-				$types = array_combine($types,$types);
935
-				if(isset($types['c'])){$color[] = $selector;}
936
-				if(isset($types['b'])){$background[] = $selector;}
937
-				if(isset($types['o'])){$border[] = $selector;}
938
-				if(isset($types['f'])){$fill[] = $selector;}
932
+			foreach ($selectors as $selector => $types) {
933
+				$selector = $compatibility ? ".bsui " . $selector : $selector;
934
+				$types = array_combine($types, $types);
935
+				if (isset($types['c'])) {$color[] = $selector; }
936
+				if (isset($types['b'])) {$background[] = $selector; }
937
+				if (isset($types['o'])) {$border[] = $selector; }
938
+				if (isset($types['f'])) {$fill[] = $selector; }
939 939
 			}
940 940
 
941 941
 			// build rules into each type
942
-			foreach($important_selectors as $selector => $types){
943
-				$selector = $compatibility ? ".bsui ".$selector : $selector;
944
-				$types = array_combine($types,$types);
945
-				if(isset($types['c'])){$color_i[] = $selector;}
946
-				if(isset($types['b'])){$background_i[] = $selector;}
947
-				if(isset($types['o'])){$border_i[] = $selector;}
948
-				if(isset($types['f'])){$fill_i[] = $selector;}
942
+			foreach ($important_selectors as $selector => $types) {
943
+				$selector = $compatibility ? ".bsui " . $selector : $selector;
944
+				$types = array_combine($types, $types);
945
+				if (isset($types['c'])) {$color_i[] = $selector; }
946
+				if (isset($types['b'])) {$background_i[] = $selector; }
947
+				if (isset($types['o'])) {$border_i[] = $selector; }
948
+				if (isset($types['f'])) {$fill_i[] = $selector; }
949 949
 			}
950 950
 
951 951
 			// add any color rules
952
-			if(!empty($color)){
953
-				$output .= implode(",",$color) . "{color: $color_code;} ";
952
+			if (!empty($color)) {
953
+				$output .= implode(",", $color) . "{color: $color_code;} ";
954 954
 			}
955
-			if(!empty($color_i)){
956
-				$output .= implode(",",$color_i) . "{color: $color_code !important;} ";
955
+			if (!empty($color_i)) {
956
+				$output .= implode(",", $color_i) . "{color: $color_code !important;} ";
957 957
 			}
958 958
 
959 959
 			// add any background color rules
960
-			if(!empty($background)){
961
-				$output .= implode(",",$background) . "{background-color: $color_code;} ";
960
+			if (!empty($background)) {
961
+				$output .= implode(",", $background) . "{background-color: $color_code;} ";
962 962
 			}
963
-			if(!empty($background_i)){
964
-				$output .= implode(",",$background_i) . "{background-color: $color_code !important;} ";
963
+			if (!empty($background_i)) {
964
+				$output .= implode(",", $background_i) . "{background-color: $color_code !important;} ";
965 965
 			}
966 966
 
967 967
 			// add any border color rules
968
-			if(!empty($border)){
969
-				$output .= implode(",",$border) . "{border-color: $color_code;} ";
968
+			if (!empty($border)) {
969
+				$output .= implode(",", $border) . "{border-color: $color_code;} ";
970 970
 			}
971
-			if(!empty($border_i)){
972
-				$output .= implode(",",$border_i) . "{border-color: $color_code !important;} ";
971
+			if (!empty($border_i)) {
972
+				$output .= implode(",", $border_i) . "{border-color: $color_code !important;} ";
973 973
 			}
974 974
 
975 975
 			// add any fill color rules
976
-			if(!empty($fill)){
977
-				$output .= implode(",",$fill) . "{fill: $color_code;} ";
976
+			if (!empty($fill)) {
977
+				$output .= implode(",", $fill) . "{fill: $color_code;} ";
978 978
 			}
979
-			if(!empty($fill_i)){
980
-				$output .= implode(",",$fill_i) . "{fill: $color_code !important;} ";
979
+			if (!empty($fill_i)) {
980
+				$output .= implode(",", $fill_i) . "{fill: $color_code !important;} ";
981 981
 			}
982 982
 
983 983
 
984 984
 			$prefix = $compatibility ? ".bsui " : "";
985 985
 
986 986
 			// darken
987
-			$darker_075 = self::css_hex_lighten_darken($color_code,"-0.075");
988
-			$darker_10 = self::css_hex_lighten_darken($color_code,"-0.10");
989
-			$darker_125 = self::css_hex_lighten_darken($color_code,"-0.125");
987
+			$darker_075 = self::css_hex_lighten_darken($color_code, "-0.075");
988
+			$darker_10 = self::css_hex_lighten_darken($color_code, "-0.10");
989
+			$darker_125 = self::css_hex_lighten_darken($color_code, "-0.125");
990 990
 
991 991
 			// lighten
992
-			$lighten_25 = self::css_hex_lighten_darken($color_code,"0.25");
992
+			$lighten_25 = self::css_hex_lighten_darken($color_code, "0.25");
993 993
 
994 994
 			// opacity see https://css-tricks.com/8-digit-hex-codes/
995
-			$op_25 = $color_code."40"; // 25% opacity
995
+			$op_25 = $color_code . "40"; // 25% opacity
996 996
 
997 997
 
998 998
 			// button states
999
-			$output .= $prefix ." .btn-secondary:hover{background-color: ".$darker_075.";    border-color: ".$darker_10.";} ";
1000
-			$output .= $prefix ." .btn-outline-secondary:not(:disabled):not(.disabled):active:focus, $prefix .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-outline-secondary.dropdown-toggle:focus{box-shadow: 0 0 0 0.2rem $op_25;} ";
1001
-			$output .= $prefix ." .btn-secondary:not(:disabled):not(.disabled):active, $prefix .btn-secondary:not(:disabled):not(.disabled).active, .show>$prefix .btn-secondary.dropdown-toggle{background-color: ".$darker_10.";    border-color: ".$darker_125.";} ";
1002
-			$output .= $prefix ." .btn-secondary:not(:disabled):not(.disabled):active:focus, $prefix .btn-secondary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-secondary.dropdown-toggle:focus {box-shadow: 0 0 0 0.2rem $op_25;} ";
999
+			$output .= $prefix . " .btn-secondary:hover{background-color: " . $darker_075 . ";    border-color: " . $darker_10 . ";} ";
1000
+			$output .= $prefix . " .btn-outline-secondary:not(:disabled):not(.disabled):active:focus, $prefix .btn-outline-secondary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-outline-secondary.dropdown-toggle:focus{box-shadow: 0 0 0 0.2rem $op_25;} ";
1001
+			$output .= $prefix . " .btn-secondary:not(:disabled):not(.disabled):active, $prefix .btn-secondary:not(:disabled):not(.disabled).active, .show>$prefix .btn-secondary.dropdown-toggle{background-color: " . $darker_10 . ";    border-color: " . $darker_125 . ";} ";
1002
+			$output .= $prefix . " .btn-secondary:not(:disabled):not(.disabled):active:focus, $prefix .btn-secondary:not(:disabled):not(.disabled).active:focus, .show>$prefix .btn-secondary.dropdown-toggle:focus {box-shadow: 0 0 0 0.2rem $op_25;} ";
1003 1003
 
1004 1004
 
1005 1005
 			return $output;
@@ -1035,8 +1035,8 @@  discard block
 block discarded – undo
1035 1035
 		/**
1036 1036
 		 * Check if we should display examples.
1037 1037
 		 */
1038
-		public function maybe_show_examples(){
1039
-			if(current_user_can('manage_options') && isset($_REQUEST['preview-aui'])){
1038
+		public function maybe_show_examples() {
1039
+			if (current_user_can('manage_options') && isset($_REQUEST['preview-aui'])) {
1040 1040
 				echo "<head>";
1041 1041
 				wp_head();
1042 1042
 				echo "</head>";
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 		 * 
1053 1053
 		 * @return string
1054 1054
 		 */
1055
-		public function get_examples(){
1055
+		public function get_examples() {
1056 1056
 			$output = '';
1057 1057
 
1058 1058
 
Please login to merge, or discard this patch.
vendor/ayecode/wp-ayecode-ui/includes/class-aui.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
 	exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @return AUI|null
34 34
 	 */
35 35
 	public static function instance() {
36
-		if ( self::$instance == null ) {
36
+		if (self::$instance == null) {
37 37
 			self::$instance = new AUI();
38 38
 		}
39 39
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 	 * @since 1.0.0
47 47
 	 */
48 48
 	private function __construct() {
49
-		if ( function_exists( "__autoload" ) ) {
50
-			spl_autoload_register( "__autoload" );
49
+		if (function_exists("__autoload")) {
50
+			spl_autoload_register("__autoload");
51 51
 		}
52
-		spl_autoload_register( array( $this, 'autoload' ) );
52
+		spl_autoload_register(array($this, 'autoload'));
53 53
 	}
54 54
 
55 55
 	/**
@@ -59,22 +59,22 @@  discard block
 block discarded – undo
59 59
 	 *
60 60
 	 * @param $classname
61 61
 	 */
62
-	private function autoload( $classname ) {
63
-		$class     = str_replace( '_', '-', strtolower( $classname ) );
64
-		$file_path = trailingslashit( dirname( __FILE__ ) ) . "components/class-" . $class . '.php';
65
-		if ( $file_path && is_readable( $file_path ) ) {
66
-			include_once( $file_path );
62
+	private function autoload($classname) {
63
+		$class     = str_replace('_', '-', strtolower($classname));
64
+		$file_path = trailingslashit(dirname(__FILE__)) . "components/class-" . $class . '.php';
65
+		if ($file_path && is_readable($file_path)) {
66
+			include_once($file_path);
67 67
 		}
68 68
 	}
69 69
 
70
-	public function render( $items = array() ) {
70
+	public function render($items = array()) {
71 71
 		$output = '';
72 72
 
73
-		if ( ! empty( $items ) ) {
74
-			foreach ( $items as $args ) {
75
-				$render = isset( $args['render'] ) ? $args['render'] : '';
76
-				if ( $render && method_exists( __CLASS__, $render ) ) {
77
-					$output .= $this->$render( $args );
73
+		if (!empty($items)) {
74
+			foreach ($items as $args) {
75
+				$render = isset($args['render']) ? $args['render'] : '';
76
+				if ($render && method_exists(__CLASS__, $render)) {
77
+					$output .= $this->$render($args);
78 78
 				}
79 79
 			}
80 80
 		}
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 	 *
92 92
 	 * @return string The rendered component.
93 93
 	 */
94
-	public function alert( $args = array() ) {
95
-		return AUI_Component_Alert::get( $args );
94
+	public function alert($args = array()) {
95
+		return AUI_Component_Alert::get($args);
96 96
 	}
97 97
 
98 98
 	/**
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 	 *
105 105
 	 * @return string The rendered component.
106 106
 	 */
107
-	public function input( $args = array() ) {
108
-		return AUI_Component_Input::input( $args );
107
+	public function input($args = array()) {
108
+		return AUI_Component_Input::input($args);
109 109
 	}
110 110
 
111 111
 	/**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 	 *
118 118
 	 * @return string The rendered component.
119 119
 	 */
120
-	public function textarea( $args = array() ) {
121
-		return AUI_Component_Input::textarea( $args );
120
+	public function textarea($args = array()) {
121
+		return AUI_Component_Input::textarea($args);
122 122
 	}
123 123
 
124 124
 	/**
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @return string The rendered component.
132 132
 	 */
133
-	public function button( $args = array() ) {
134
-		return AUI_Component_Button::get( $args );
133
+	public function button($args = array()) {
134
+		return AUI_Component_Button::get($args);
135 135
 	}
136 136
 
137 137
 	/**
@@ -143,22 +143,22 @@  discard block
 block discarded – undo
143 143
 	 *
144 144
 	 * @return string The rendered component.
145 145
 	 */
146
-	public function badge( $args = array() ) {
146
+	public function badge($args = array()) {
147 147
 		$defaults = array(
148 148
 			'class' => 'badge badge-primary align-middle',
149 149
 		);
150 150
 
151 151
 		// maybe set type
152
-		if ( empty( $args['href'] ) ) {
152
+		if (empty($args['href'])) {
153 153
 			$defaults['type'] = 'badge';
154 154
 		}
155 155
 
156 156
 		/**
157 157
 		 * Parse incoming $args into an array and merge it with $defaults
158 158
 		 */
159
-		$args = wp_parse_args( $args, $defaults );
159
+		$args = wp_parse_args($args, $defaults);
160 160
 
161
-		return AUI_Component_Button::get( $args );
161
+		return AUI_Component_Button::get($args);
162 162
 	}
163 163
 
164 164
 	/**
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return string The rendered component.
172 172
 	 */
173
-	public function dropdown( $args = array() ) {
174
-		return AUI_Component_Dropdown::get( $args );
173
+	public function dropdown($args = array()) {
174
+		return AUI_Component_Dropdown::get($args);
175 175
 	}
176 176
 
177 177
 	/**
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
 	 *
184 184
 	 * @return string The rendered component.
185 185
 	 */
186
-	public function select( $args = array() ) {
187
-		return AUI_Component_Input::select( $args );
186
+	public function select($args = array()) {
187
+		return AUI_Component_Input::select($args);
188 188
 	}
189 189
 
190 190
 	/**
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 	 *
197 197
 	 * @return string The rendered component.
198 198
 	 */
199
-	public function pagination( $args = array() ) {
200
-		return AUI_Component_Pagination::get( $args );
199
+	public function pagination($args = array()) {
200
+		return AUI_Component_Pagination::get($args);
201 201
 	}
202 202
 
203 203
 }
204 204
\ No newline at end of file
Please login to merge, or discard this patch.