@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | if($type=='file' ){ |
80 | 80 | $label_after = true; // if type file we need the label after |
81 | 81 | $args['class'] .= ' custom-file-input '; |
82 | - }elseif($type=='checkbox'){ |
|
82 | + } elseif($type=='checkbox'){ |
|
83 | 83 | $label_after = true; // if type file we need the label after |
84 | 84 | $args['class'] .= ' custom-control-input '; |
85 | - }elseif($type=='datepicker' || $type=='timepicker'){ |
|
85 | + } elseif($type=='datepicker' || $type=='timepicker'){ |
|
86 | 86 | $type = 'text'; |
87 | 87 | //$args['class'] .= ' aui-flatpickr bg-initial '; |
88 | 88 | $args['class'] .= ' bg-initial '; |
@@ -166,8 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | // label |
168 | 168 | if(!empty($args['label'])){ |
169 | - if($type == 'file'){$label_args['class'] .= 'custom-file-label';} |
|
170 | - elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';} |
|
169 | + if($type == 'file'){$label_args['class'] .= 'custom-file-label';} elseif($type == 'checkbox'){$label_args['class'] .= 'custom-control-label';} |
|
171 | 170 | $label = self::label( $label_args, $type ); |
172 | 171 | } |
173 | 172 | |
@@ -188,7 +187,7 @@ discard block |
||
188 | 187 | 'content' => $output, |
189 | 188 | 'class' => 'form-group custom-file' |
190 | 189 | ) ); |
191 | - }elseif($type == 'checkbox'){ |
|
190 | + } elseif($type == 'checkbox'){ |
|
192 | 191 | $wrap_class = $args['switch'] ? 'custom-switch' : 'custom-checkbox'; |
193 | 192 | $output = self::wrap( array( |
194 | 193 | 'content' => $output, |
@@ -198,7 +197,7 @@ discard block |
||
198 | 197 | if($args['label_type']=='horizontal'){ |
199 | 198 | $output = '<div class="col-sm-2 col-form-label"></div><div class="col-sm-10">' . $output . '</div>'; |
200 | 199 | } |
201 | - }elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){ |
|
200 | + } elseif($type == 'password' && $args['password_toggle'] && !$args['input_group_right']){ |
|
202 | 201 | |
203 | 202 | |
204 | 203 | // allow password field to toggle view |
@@ -322,7 +321,7 @@ discard block |
||
322 | 321 | |
323 | 322 | // label |
324 | 323 | if(!empty($args['label']) && is_array($args['label'])){ |
325 | - }elseif(!empty($args['label']) && !$label_after){ |
|
324 | + } elseif(!empty($args['label']) && !$label_after){ |
|
326 | 325 | $label_args = array( |
327 | 326 | 'title'=> $args['label'], |
328 | 327 | 'for'=> $args['id'], |
@@ -357,7 +356,7 @@ discard block |
||
357 | 356 | |
358 | 357 | wp_editor( $content, $editor_id, $settings ); |
359 | 358 | $output .= ob_get_clean(); |
360 | - }else{ |
|
359 | + } else{ |
|
361 | 360 | |
362 | 361 | // open |
363 | 362 | $output .= '<textarea '; |
@@ -479,7 +478,7 @@ discard block |
||
479 | 478 | // maybe hide labels //@todo set a global option for visibility class |
480 | 479 | if($type == 'file' || $type == 'checkbox' || $type == 'radio' || !empty($args['label_type']) ){ |
481 | 480 | $class = $args['class']; |
482 | - }else{ |
|
481 | + } else{ |
|
483 | 482 | $class = 'sr-only '.$args['class']; |
484 | 483 | } |
485 | 484 | |
@@ -582,7 +581,7 @@ discard block |
||
582 | 581 | $output .= '</'.sanitize_html_class($args['type']).'>'; |
583 | 582 | |
584 | 583 | |
585 | - }else{ |
|
584 | + } else{ |
|
586 | 585 | $output = $args['content']; |
587 | 586 | } |
588 | 587 | |
@@ -644,7 +643,7 @@ discard block |
||
644 | 643 | if(!empty($args['select2'])){ |
645 | 644 | $args['class'] .= ' aui-select2'; |
646 | 645 | $is_select2 = true; |
647 | - }elseif( strpos($args['class'], 'aui-select2') !== false){ |
|
646 | + } elseif( strpos($args['class'], 'aui-select2') !== false){ |
|
648 | 647 | $is_select2 = true; |
649 | 648 | } |
650 | 649 | |
@@ -663,7 +662,7 @@ discard block |
||
663 | 662 | |
664 | 663 | // label |
665 | 664 | if(!empty($args['label']) && is_array($args['label'])){ |
666 | - }elseif(!empty($args['label']) && !$label_after){ |
|
665 | + } elseif(!empty($args['label']) && !$label_after){ |
|
667 | 666 | $label_args = array( |
668 | 667 | 'title'=> $args['label'], |
669 | 668 | 'for'=> $args['id'], |
@@ -738,7 +737,7 @@ discard block |
||
738 | 737 | // placeholder |
739 | 738 | if(!empty($args['placeholder']) && !$is_select2){ |
740 | 739 | $output .= '<option value="" disabled selected hidden>'.esc_attr($args['placeholder']).'</option>'; |
741 | - }elseif($is_select2 && !empty($args['placeholder'])){ |
|
740 | + } elseif($is_select2 && !empty($args['placeholder'])){ |
|
742 | 741 | $output .= "<option></option>"; // select2 needs an empty select to fill the placeholder |
743 | 742 | } |
744 | 743 | |
@@ -747,7 +746,7 @@ discard block |
||
747 | 746 | |
748 | 747 | if(!is_array($args['options'])){ |
749 | 748 | $output .= $args['options']; // not the preferred way but an option |
750 | - }else{ |
|
749 | + } else{ |
|
751 | 750 | foreach($args['options'] as $val => $name){ |
752 | 751 | $selected = ''; |
753 | 752 | if(is_array($name)){ |
@@ -766,7 +765,7 @@ discard block |
||
766 | 765 | |
767 | 766 | $output .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
768 | 767 | } |
769 | - }else{ |
|
768 | + } else{ |
|
770 | 769 | if(!empty($args['value'])){ |
771 | 770 | if(is_array($args['value'])){ |
772 | 771 | $selected = in_array($val,$args['value']) ? 'selected="selected"' : ''; |
@@ -986,7 +985,7 @@ discard block |
||
986 | 985 | |
987 | 986 | // label |
988 | 987 | if(!empty($args['label']) && is_array($args['label'])){ |
989 | - }elseif(!empty($args['label'])){ |
|
988 | + } elseif(!empty($args['label'])){ |
|
990 | 989 | $output .= self::label(array('title'=>$args['label'],'for'=>$args['id'].$count,'class'=>'form-check-label'),'radio'); |
991 | 990 | } |
992 | 991 |
@@ -207,7 +207,7 @@ |
||
207 | 207 | foreach($args as $key => $val){ |
208 | 208 | $output .= ' '.sanitize_html_class($key).'="'.esc_attr($val).'" '; |
209 | 209 | } |
210 | - }else{ |
|
210 | + } else{ |
|
211 | 211 | $output .= ' '.$args.' '; |
212 | 212 | } |
213 | 213 |
@@ -87,8 +87,9 @@ discard block |
||
87 | 87 | |
88 | 88 | if ( !empty( $args ) ) { |
89 | 89 | // Check for backward compatibility |
90 | - if ( is_string( $args ) ) |
|
91 | - $args = str_replace( '?', '', $args ); |
|
90 | + if ( is_string( $args ) ) { |
|
91 | + $args = str_replace( '?', '', $args ); |
|
92 | + } |
|
92 | 93 | |
93 | 94 | $args = wp_parse_args( $args ); |
94 | 95 | |
@@ -108,8 +109,9 @@ discard block |
||
108 | 109 | |
109 | 110 | if ( !empty( $args ) ) { |
110 | 111 | // Check for backward compatibility |
111 | - if ( is_string( $args ) ) |
|
112 | - $args = str_replace( '?', '', $args ); |
|
112 | + if ( is_string( $args ) ) { |
|
113 | + $args = str_replace( '?', '', $args ); |
|
114 | + } |
|
113 | 115 | |
114 | 116 | $args = wp_parse_args( $args ); |
115 | 117 | |
@@ -131,8 +133,9 @@ discard block |
||
131 | 133 | $success_page = wpinv_get_option( 'success_page', 0 ); |
132 | 134 | $success_page = get_permalink( $success_page ); |
133 | 135 | |
134 | - if ( $query_string ) |
|
135 | - $success_page .= $query_string; |
|
136 | + if ( $query_string ) { |
|
137 | + $success_page .= $query_string; |
|
138 | + } |
|
136 | 139 | |
137 | 140 | return apply_filters( 'wpinv_success_page_url', $success_page ); |
138 | 141 | } |
@@ -141,8 +144,9 @@ discard block |
||
141 | 144 | $uri = wpinv_get_option( 'failure_page', '' ); |
142 | 145 | $uri = ! empty( $uri ) ? trailingslashit( get_permalink( $uri ) ) : home_url(); |
143 | 146 | |
144 | - if ( $extras ) |
|
145 | - $uri .= $extras; |
|
147 | + if ( $extras ) { |
|
148 | + $uri .= $extras; |
|
149 | + } |
|
146 | 150 | |
147 | 151 | return apply_filters( 'wpinv_get_failed_transaction_uri', $uri ); |
148 | 152 | } |
@@ -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. |
@@ -1647,7 +1647,7 @@ discard block |
||
1647 | 1647 | var prev_attributes = []; |
1648 | 1648 | |
1649 | 1649 | var term_query_type = ''; |
1650 | - 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 "[]";} ?>; |
|
1650 | + 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 "[]";} ?>; |
|
1651 | 1651 | const taxonomies_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
1652 | 1652 | const sort_by_<?php echo str_replace("-","_", $this->id);?> = [{label: "Please wait", value: 0}]; |
1653 | 1653 | |
@@ -1784,7 +1784,7 @@ discard block |
||
1784 | 1784 | |
1785 | 1785 | // taxonomies |
1786 | 1786 | if( $value && 'post_type' in prev_attributes[props.id] && 'category' in prev_attributes[props.id] && run ){ |
1787 | - 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 => { |
|
1787 | + 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 => { |
|
1788 | 1788 | while (taxonomies_<?php echo str_replace("-","_", $this->id);?>.length) { |
1789 | 1789 | taxonomies_<?php echo str_replace("-","_", $this->id);?>.pop(); |
1790 | 1790 | } |
@@ -1958,7 +1958,7 @@ discard block |
||
1958 | 1958 | $panel_count ++; |
1959 | 1959 | |
1960 | 1960 | } |
1961 | - }else { |
|
1961 | + } else { |
|
1962 | 1962 | ?> |
1963 | 1963 | el(wp.components.PanelBody, { |
1964 | 1964 | title: '<?php esc_attr_e( "Settings" ); ?>', |
@@ -1982,7 +1982,7 @@ discard block |
||
1982 | 1982 | // If the user sets block-output array then build it |
1983 | 1983 | if ( ! empty( $this->options['block-output'] ) ) { |
1984 | 1984 | $this->block_element( $this->options['block-output'] ); |
1985 | - }else{ |
|
1985 | + } else{ |
|
1986 | 1986 | // if no block-output is set then we try and get the shortcode html output via ajax. |
1987 | 1987 | ?> |
1988 | 1988 | el('div', { |
@@ -2052,7 +2052,7 @@ discard block |
||
2052 | 2052 | ?> |
2053 | 2053 | return content; |
2054 | 2054 | <?php |
2055 | - }else{ |
|
2055 | + } else{ |
|
2056 | 2056 | ?> |
2057 | 2057 | var block_wrap = 'div'; |
2058 | 2058 | if (attr.hasOwnProperty("block_wrap")) { |
@@ -2157,8 +2157,7 @@ discard block |
||
2157 | 2157 | $key: value |
2158 | 2158 | }); |
2159 | 2159 | },"; |
2160 | - } |
|
2161 | - elseif ( $args['type'] == 'checkbox' ) { |
|
2160 | + } elseif ( $args['type'] == 'checkbox' ) { |
|
2162 | 2161 | $type = 'CheckboxControl'; |
2163 | 2162 | $extra .= "checked: props.attributes.$key,"; |
2164 | 2163 | $onchange = "props.setAttributes({ $key: ! props.attributes.$key } )"; |
@@ -2169,9 +2168,9 @@ discard block |
||
2169 | 2168 | |
2170 | 2169 | if($args['name'] == 'category' && !empty($args['post_type_linked'])){ |
2171 | 2170 | $options .= "options: taxonomies_".str_replace("-","_", $this->id).","; |
2172 | - }elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
2171 | + } elseif($args['name'] == 'sort_by' && !empty($args['post_type_linked'])){ |
|
2173 | 2172 | $options .= "options: sort_by_".str_replace("-","_", $this->id).","; |
2174 | - }else { |
|
2173 | + } else { |
|
2175 | 2174 | |
2176 | 2175 | if ( ! empty( $args['options'] ) ) { |
2177 | 2176 | $options .= "options: ["; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | if ( ! $result && $option) { |
86 | 86 | if( $option == 'color_primary' ){ |
87 | 87 | $result = AUI_PRIMARY_COLOR; |
88 | - }elseif( $option == 'color_secondary' ){ |
|
88 | + } elseif( $option == 'color_secondary' ){ |
|
89 | 89 | $result = AUI_SECONDARY_COLOR; |
90 | 90 | } |
91 | 91 | } |
@@ -126,8 +126,12 @@ discard block |
||
126 | 126 | public function constants(){ |
127 | 127 | define('AUI_PRIMARY_COLOR_ORIGINAL', "#1e73be"); |
128 | 128 | define('AUI_SECONDARY_COLOR_ORIGINAL', '#6c757d'); |
129 | - if (!defined('AUI_PRIMARY_COLOR')) define('AUI_PRIMARY_COLOR', AUI_PRIMARY_COLOR_ORIGINAL); |
|
130 | - if (!defined('AUI_SECONDARY_COLOR')) define('AUI_SECONDARY_COLOR', AUI_SECONDARY_COLOR_ORIGINAL); |
|
129 | + if (!defined('AUI_PRIMARY_COLOR')) { |
|
130 | + define('AUI_PRIMARY_COLOR', AUI_PRIMARY_COLOR_ORIGINAL); |
|
131 | + } |
|
132 | + if (!defined('AUI_SECONDARY_COLOR')) { |
|
133 | + define('AUI_SECONDARY_COLOR', AUI_SECONDARY_COLOR_ORIGINAL); |
|
134 | + } |
|
131 | 135 | } |
132 | 136 | |
133 | 137 | /** |
@@ -822,12 +826,12 @@ discard block |
||
822 | 826 | is_admin() ? wp_enqueue_script( 'bootstrap-js-bundle', '', null, null, true ) : wp_enqueue_script( 'bootstrap-js-bundle'); |
823 | 827 | $script = $this->inline_script(); |
824 | 828 | wp_add_inline_script( 'bootstrap-js-bundle', $script ); |
825 | - }elseif($this->settings[$js_setting]=='popper'){ |
|
829 | + } elseif($this->settings[$js_setting]=='popper'){ |
|
826 | 830 | $url = $this->url.'assets/js/popper.min.js'; |
827 | 831 | wp_register_script( 'bootstrap-js-popper', $url, array('select2','jquery'), $this->latest ); |
828 | 832 | wp_enqueue_script( 'bootstrap-js-popper' ); |
829 | 833 | $load_inline = true; |
830 | - }else{ |
|
834 | + } else{ |
|
831 | 835 | $load_inline = true; |
832 | 836 | } |
833 | 837 |