@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | if($type=='file' ){ |
79 | 79 | $label_after = true; // if type file we need the label after |
80 | 80 | $args['class'] .= ' custom-file-input '; |
81 | - }elseif($type=='checkbox'){ |
|
81 | + } elseif($type=='checkbox'){ |
|
82 | 82 | $label_after = true; // if type file we need the label after |
83 | 83 | $args['class'] .= ' custom-control-input '; |
84 | - }elseif($type=='datepicker' || $type=='timepicker'){ |
|
84 | + } elseif($type=='datepicker' || $type=='timepicker'){ |
|
85 | 85 | $type = 'text'; |
86 | 86 | $args['class'] .= ' aui-flatpickr bg-initial '; |
87 | 87 | |
@@ -163,8 +163,7 @@ discard block |
||
163 | 163 | |
164 | 164 | // label |
165 | 165 | if(!empty($args['label'])){ |
166 | - if($type == 'file'){$label_args['class'] .= 'custom-file-label';} |
|
167 | - elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';} |
|
166 | + if($type == 'file'){$label_args['class'] .= 'custom-file-label';} elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';} |
|
168 | 167 | $label = self::label( $label_args, $type ); |
169 | 168 | } |
170 | 169 | |
@@ -185,7 +184,7 @@ discard block |
||
185 | 184 | 'content' => $output, |
186 | 185 | 'class' => 'form-group custom-file' |
187 | 186 | ) ); |
188 | - }elseif($type == 'checkbox'){ |
|
187 | + } elseif($type == 'checkbox'){ |
|
189 | 188 | $wrap_class = $args['switch'] ? 'custom-switch' : 'custom-checkbox'; |
190 | 189 | $output = self::wrap( array( |
191 | 190 | 'content' => $output, |
@@ -195,7 +194,7 @@ discard block |
||
195 | 194 | if($args['label_type']=='horizontal'){ |
196 | 195 | $output = '<div class="col-sm-2 col-form-label"></div><div class="col-sm-10">' . $output . '</div>'; |
197 | 196 | } |
198 | - }elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){ |
|
197 | + } elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){ |
|
199 | 198 | |
200 | 199 | |
201 | 200 | // allow password field to toggle view |
@@ -315,7 +314,7 @@ discard block |
||
315 | 314 | |
316 | 315 | // label |
317 | 316 | if(!empty($args['label']) && is_array($args['label'])){ |
318 | - }elseif(!empty($args['label']) && !$label_after){ |
|
317 | + } elseif(!empty($args['label']) && !$label_after){ |
|
319 | 318 | $label_args = array( |
320 | 319 | 'title'=> $args['label'], |
321 | 320 | 'for'=> $args['id'], |
@@ -350,7 +349,7 @@ discard block |
||
350 | 349 | |
351 | 350 | wp_editor( $content, $editor_id, $settings ); |
352 | 351 | $output .= ob_get_clean(); |
353 | - }else{ |
|
352 | + } else{ |
|
354 | 353 | |
355 | 354 | // open |
356 | 355 | $output .= '<textarea '; |
@@ -470,7 +469,7 @@ discard block |
||
470 | 469 | // maybe hide labels //@todo set a global option for visibility class |
471 | 470 | if($type == 'file' || $type == 'checkbox' || $type == 'radio' || !empty($args['label_type']) ){ |
472 | 471 | $class = $args['class']; |
473 | - }else{ |
|
472 | + } else{ |
|
474 | 473 | $class = 'sr-only '.$args['class']; |
475 | 474 | } |
476 | 475 | |
@@ -560,7 +559,7 @@ discard block |
||
560 | 559 | $output .= '</'.sanitize_html_class($args['type']).'>'; |
561 | 560 | |
562 | 561 | |
563 | - }else{ |
|
562 | + } else{ |
|
564 | 563 | $output = $args['content']; |
565 | 564 | } |
566 | 565 | |
@@ -621,7 +620,7 @@ discard block |
||
621 | 620 | if(!empty($args['select2'])){ |
622 | 621 | $args['class'] .= ' aui-select2'; |
623 | 622 | $is_select2 = true; |
624 | - }elseif( strpos($args['class'], 'aui-select2') !== false){ |
|
623 | + } elseif( strpos($args['class'], 'aui-select2') !== false){ |
|
625 | 624 | $is_select2 = true; |
626 | 625 | } |
627 | 626 | |
@@ -640,7 +639,7 @@ discard block |
||
640 | 639 | |
641 | 640 | // label |
642 | 641 | if(!empty($args['label']) && is_array($args['label'])){ |
643 | - }elseif(!empty($args['label']) && !$label_after){ |
|
642 | + } elseif(!empty($args['label']) && !$label_after){ |
|
644 | 643 | $label_args = array( |
645 | 644 | 'title'=> $args['label'], |
646 | 645 | 'for'=> $args['id'], |
@@ -709,7 +708,7 @@ discard block |
||
709 | 708 | // placeholder |
710 | 709 | if(!empty($args['placeholder']) && !$is_select2){ |
711 | 710 | $output .= '<option value="" disabled selected hidden>'.esc_attr($args['placeholder']).'</option>'; |
712 | - }elseif($is_select2 && !empty($args['placeholder'])){ |
|
711 | + } elseif($is_select2 && !empty($args['placeholder'])){ |
|
713 | 712 | $output .= "<option></option>"; // select2 needs an empty select to fill the placeholder |
714 | 713 | } |
715 | 714 | |
@@ -734,7 +733,7 @@ discard block |
||
734 | 733 | |
735 | 734 | $output .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
736 | 735 | } |
737 | - }else{ |
|
736 | + } else{ |
|
738 | 737 | if(!empty($args['value'])){ |
739 | 738 | if(is_array($args['value'])){ |
740 | 739 | $selected = in_array($val,$args['value']) ? 'selected="selected"' : ''; |
@@ -948,7 +947,7 @@ discard block |
||
948 | 947 | |
949 | 948 | // label |
950 | 949 | if(!empty($args['label']) && is_array($args['label'])){ |
951 | - }elseif(!empty($args['label'])){ |
|
950 | + } elseif(!empty($args['label'])){ |
|
952 | 951 | $output .= self::label(array('title'=>$args['label'],'for'=>$args['id'].$count,'class'=>'form-check-label'),'radio'); |
953 | 952 | } |
954 | 953 |
@@ -542,12 +542,12 @@ |
||
542 | 542 | is_admin() ? wp_enqueue_script( 'bootstrap-js-bundle', '', null, null, true ) : wp_enqueue_script( 'bootstrap-js-bundle'); |
543 | 543 | $script = $this->inline_script(); |
544 | 544 | wp_add_inline_script( 'bootstrap-js-bundle', $script ); |
545 | - }elseif($this->settings[$js_setting]=='popper'){ |
|
545 | + } elseif($this->settings[$js_setting]=='popper'){ |
|
546 | 546 | $url = $this->url.'assets/js/popper.min.js'; |
547 | 547 | wp_register_script( 'bootstrap-js-popper', $url, array('jquery'), $this->latest ); |
548 | 548 | wp_enqueue_script( 'bootstrap-js-popper' ); |
549 | 549 | $load_inline = true; |
550 | - }else{ |
|
550 | + } else{ |
|
551 | 551 | $load_inline = true; |
552 | 552 | } |
553 | 553 |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | <?php |
662 | 662 | if(! empty( $insert_shortcode_function )){ |
663 | 663 | echo $insert_shortcode_function; |
664 | - }else{ |
|
664 | + } else{ |
|
665 | 665 | |
666 | 666 | /** |
667 | 667 | * Function for super duper insert shortcode. |
@@ -1645,7 +1645,7 @@ discard block |
||
1645 | 1645 | var prev_attributes = []; |
1646 | 1646 | |
1647 | 1647 | var term_query_type = ''; |
1648 | - var post_type_rest_slugs = <?php if(! empty( $this->arguments ) && isset($this->arguments['post_type']['onchange_rest']['values'])){echo "[".json_encode($this->arguments['post_type']['onchange_rest']['values'])."]";}else{echo "[]";} ?>; |
|
1648 | + var post_type_rest_slugs = <?php if(! empty( $this->arguments ) && isset($this->arguments['post_type']['onchange_rest']['values'])){echo "[".json_encode($this->arguments['post_type']['onchange_rest']['values'])."]";} else{echo "[]";} ?>; |
|
1649 | 1649 | const taxonomies_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
1650 | 1650 | |
1651 | 1651 | /** |
@@ -1774,7 +1774,7 @@ discard block |
||
1774 | 1774 | } |
1775 | 1775 | if('post_type' in prev_attributes[props.id] && 'category' in prev_attributes[props.id] && $pt != term_query_type ){ |
1776 | 1776 | term_query_type = $pt; |
1777 | - wp.apiFetch({path: "<?php if(isset($this->arguments['post_type']['onchange_rest']['path'])){echo $this->arguments['post_type']['onchange_rest']['path'];}else{'/wp/v2/"+$value+"/categories';} ?>"}).then(terms => { |
|
1777 | + wp.apiFetch({path: "<?php if(isset($this->arguments['post_type']['onchange_rest']['path'])){echo $this->arguments['post_type']['onchange_rest']['path'];} else{'/wp/v2/"+$value+"/categories';} ?>"}).then(terms => { |
|
1778 | 1778 | while (taxonomies_<?php echo str_replace("-","_", $this->id);?>.length) { |
1779 | 1779 | taxonomies_<?php echo str_replace("-","_", $this->id);?>.pop(); |
1780 | 1780 | } |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | $panel_count ++; |
1923 | 1923 | |
1924 | 1924 | } |
1925 | - }else { |
|
1925 | + } else { |
|
1926 | 1926 | ?> |
1927 | 1927 | el(wp.components.PanelBody, { |
1928 | 1928 | title: '<?php esc_attr_e( "Settings" ); ?>', |
@@ -1946,7 +1946,7 @@ discard block |
||
1946 | 1946 | // If the user sets block-output array then build it |
1947 | 1947 | if ( ! empty( $this->options['block-output'] ) ) { |
1948 | 1948 | $this->block_element( $this->options['block-output'] ); |
1949 | - }else{ |
|
1949 | + } else{ |
|
1950 | 1950 | // if no block-output is set then we try and get the shortcode html output via ajax. |
1951 | 1951 | ?> |
1952 | 1952 | el('div', { |
@@ -2016,7 +2016,7 @@ discard block |
||
2016 | 2016 | ?> |
2017 | 2017 | return content; |
2018 | 2018 | <?php |
2019 | - }else{ |
|
2019 | + } else{ |
|
2020 | 2020 | ?> |
2021 | 2021 | var block_wrap = 'div'; |
2022 | 2022 | if (attr.hasOwnProperty("block_wrap")) { |
@@ -2121,8 +2121,7 @@ discard block |
||
2121 | 2121 | $key: value |
2122 | 2122 | }); |
2123 | 2123 | },"; |
2124 | - } |
|
2125 | - elseif ( $args['type'] == 'checkbox' ) { |
|
2124 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
2126 | 2125 | $type = 'CheckboxControl'; |
2127 | 2126 | $extra .= "checked: props.attributes.$key,"; |
2128 | 2127 | $onchange = "props.setAttributes({ $key: ! props.attributes.$key } )"; |
@@ -2133,7 +2132,7 @@ discard block |
||
2133 | 2132 | |
2134 | 2133 | if($args['name'] == 'category' && !empty($args['post_type_linked'])){ |
2135 | 2134 | $options .= "options: taxonomies_".str_replace("-","_", $this->id).","; |
2136 | - }else { |
|
2135 | + } else { |
|
2137 | 2136 | |
2138 | 2137 | if ( ! empty( $args['options'] ) ) { |
2139 | 2138 | $options .= "options: ["; |