@@ -5,7 +5,9 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // Exit if accessed directly |
8 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
8 | +if ( ! defined( 'ABSPATH' ) ) { |
|
9 | + exit; |
|
10 | +} |
|
9 | 11 | |
10 | 12 | // Load WP_List_Table if not loaded |
11 | 13 | if ( ! class_exists( 'WP_List_Table' ) ) { |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | if($type=='a'){ |
50 | 50 | $new_window = !empty($args['new_window']) ? ' target="_blank" ' : ''; |
51 | 51 | $output .= '<a href="' . $args['href'] . '"'.$new_window; |
52 | - }elseif($type=='badge'){ |
|
52 | + } elseif($type=='badge'){ |
|
53 | 53 | $output .= '<span '; |
54 | - }else{ |
|
54 | + } else{ |
|
55 | 55 | $output .= '<button type="' . $type . '" '; |
56 | 56 | } |
57 | 57 | |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | // close |
119 | 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 |
@@ -42,10 +42,7 @@ |
||
42 | 42 | |
43 | 43 | // set default icon |
44 | 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>';} |
|
45 | + if($type=='danger'){$icon = '<i class="fas fa-exclamation-circle"></i>';} elseif($type=='warning'){$icon = '<i class="fas fa-exclamation-triangle"></i>';} elseif($type=='success'){$icon = '<i class="fas fa-check-circle"></i>';} elseif($type=='info'){$icon = '<i class="fas fa-info-circle"></i>';} |
|
49 | 46 | } |
50 | 47 | |
51 | 48 | $data = ''; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | // dropdown-menu |
56 | 56 | if(!empty($args['dropdown_menu'])){ |
57 | 57 | $output .= $args['dropdown_menu']; |
58 | - }elseif(!empty($args['dropdown_items'])){ |
|
58 | + } elseif(!empty($args['dropdown_items'])){ |
|
59 | 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>'; |
@@ -5,7 +5,9 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // Exit if accessed directly |
8 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
8 | +if ( ! defined( 'ABSPATH' ) ) { |
|
9 | + exit; |
|
10 | +} |
|
9 | 11 | |
10 | 12 | // Load WP_List_Table if not loaded |
11 | 13 | if ( ! class_exists( 'WP_List_Table' ) ) { |
@@ -124,8 +124,11 @@ |
||
124 | 124 | </select> |
125 | 125 | <?php elseif ( ! empty( $field['type'] ) && 'checkbox' === $field['type'] ) : ?> |
126 | 126 | <input type="checkbox" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="1" class="<?php echo esc_attr( $field['class'] ); ?>" <?php checked( (int) get_user_meta( $user->ID, $key, true ), 1, true ); ?> /> |
127 | - <?php else : ?> |
|
128 | - <input type="text" name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>" class="<?php echo ( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>" /> |
|
127 | + <?php else { |
|
128 | + : ?> |
|
129 | + <input type="text" name="<?php echo esc_attr( $key ); |
|
130 | +} |
|
131 | +?>" id="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>" class="<?php echo ( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>" /> |
|
129 | 132 | <?php endif; ?> |
130 | 133 | <p class="description"><?php echo wp_kses_post( $field['description'] ); ?></p> |
131 | 134 | </td> |
@@ -218,8 +218,9 @@ discard block |
||
218 | 218 | |
219 | 219 | // Setup possible parts |
220 | 220 | $templates = array(); |
221 | - if ( isset( $name ) ) |
|
222 | - $templates[] = $slug . '-' . $name . '.php'; |
|
221 | + if ( isset( $name ) ) { |
|
222 | + $templates[] = $slug . '-' . $name . '.php'; |
|
223 | + } |
|
223 | 224 | $templates[] = $slug . '.php'; |
224 | 225 | |
225 | 226 | // Allow template parts to be filtered |
@@ -237,8 +238,9 @@ discard block |
||
237 | 238 | foreach ( (array)$template_names as $template_name ) { |
238 | 239 | |
239 | 240 | // Continue if template is empty |
240 | - if ( empty( $template_name ) ) |
|
241 | - continue; |
|
241 | + if ( empty( $template_name ) ) { |
|
242 | + continue; |
|
243 | + } |
|
242 | 244 | |
243 | 245 | // Trim off any slashes from the template name |
244 | 246 | $template_name = ltrim( $template_name, '/' ); |
@@ -257,8 +259,9 @@ discard block |
||
257 | 259 | } |
258 | 260 | } |
259 | 261 | |
260 | - if ( ( true == $load ) && ! empty( $located ) ) |
|
261 | - load_template( $located, $require_once ); |
|
262 | + if ( ( true == $load ) && ! empty( $located ) ) { |
|
263 | + load_template( $located, $require_once ); |
|
264 | + } |
|
262 | 265 | |
263 | 266 | return $located; |
264 | 267 | } |
@@ -336,8 +339,9 @@ discard block |
||
336 | 339 | function wpinv_html_dropdown( $name = 'wpinv_discounts', $selected = 0, $status = '' ) { |
337 | 340 | $args = array( 'nopaging' => true ); |
338 | 341 | |
339 | - if ( ! empty( $status ) ) |
|
340 | - $args['post_status'] = $status; |
|
342 | + if ( ! empty( $status ) ) { |
|
343 | + $args['post_status'] = $status; |
|
344 | + } |
|
341 | 345 | |
342 | 346 | $discounts = wpinv_get_discounts( $args ); |
343 | 347 | $options = array(); |
@@ -156,7 +156,7 @@ |
||
156 | 156 | $this->set_id( $invoice_id ); |
157 | 157 | } elseif ( is_scalar( $invoice ) && $invoice_id = self::get_invoice_id_by_field( $invoice, 'transaction_id' ) ) { |
158 | 158 | $this->set_id( $invoice_id ); |
159 | - }else { |
|
159 | + } else { |
|
160 | 160 | $this->set_object_read( true ); |
161 | 161 | } |
162 | 162 |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | if ( !empty( $load_xml ) && !empty( $load_xml->geoplugin_countryCode ) ) { |
713 | 713 | $wpinv_ip_address_country = (string)$load_xml->geoplugin_countryCode; |
714 | 714 | } |
715 | - }elseif(!empty( $ip )){ |
|
715 | + } elseif(!empty( $ip )){ |
|
716 | 716 | $url = 'http://ip-api.com/json/' . $ip; |
717 | 717 | $response = wp_remote_get($url); |
718 | 718 | |
@@ -1513,16 +1513,18 @@ discard block |
||
1513 | 1513 | |
1514 | 1514 | if ( !empty( $tax_rates ) ) { |
1515 | 1515 | foreach ( $tax_rates as $key => $tax_rate ) { |
1516 | - if ( $country != $tax_rate['country'] ) |
|
1517 | - continue; |
|
1516 | + if ( $country != $tax_rate['country'] ) { |
|
1517 | + continue; |
|
1518 | + } |
|
1518 | 1519 | |
1519 | 1520 | if ( !empty( $tax_rate['global'] ) ) { |
1520 | 1521 | if ( 0 !== $tax_rate['rate'] || !empty( $tax_rate['rate'] ) ) { |
1521 | 1522 | $rate = number_format( $tax_rate['rate'], 4 ); |
1522 | 1523 | } |
1523 | 1524 | } else { |
1524 | - if ( empty( $tax_rate['state'] ) || strtolower( $state ) != strtolower( $tax_rate['state'] ) ) |
|
1525 | - continue; |
|
1525 | + if ( empty( $tax_rate['state'] ) || strtolower( $state ) != strtolower( $tax_rate['state'] ) ) { |
|
1526 | + continue; |
|
1527 | + } |
|
1526 | 1528 | |
1527 | 1529 | $state_rate = $tax_rate['rate']; |
1528 | 1530 | if ( 0 !== $state_rate || !empty( $state_rate ) ) { |