@@ -132,11 +132,13 @@ |
||
132 | 132 | if ( 'id' == strtolower( $field ) ) { |
133 | 133 | // Make sure the value is numeric to avoid casting objects, for example, |
134 | 134 | // to int 1. |
135 | - if ( ! is_numeric( $value ) ) |
|
136 | - return false; |
|
135 | + if ( ! is_numeric( $value ) ) { |
|
136 | + return false; |
|
137 | + } |
|
137 | 138 | $value = intval( $value ); |
138 | - if ( $value < 1 ) |
|
139 | - return false; |
|
139 | + if ( $value < 1 ) { |
|
140 | + return false; |
|
141 | + } |
|
140 | 142 | } |
141 | 143 | |
142 | 144 | if ( ! $value || ! is_string( $field ) ) { |
@@ -974,8 +974,9 @@ |
||
974 | 974 | return false; |
975 | 975 | } |
976 | 976 | |
977 | - if ( empty( $this->ID ) ) |
|
978 | - return false; |
|
977 | + if ( empty( $this->ID ) ) { |
|
978 | + return false; |
|
979 | + } |
|
979 | 980 | |
980 | 981 | if ( ( ( is_user_logged_in() && wpinv_current_user_can_manage_invoicing() ) || $added_by_user ) && !$system ) { |
981 | 982 | $user = get_user_by( 'id', get_current_user_id() ); |
@@ -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> |
@@ -3,7 +3,9 @@ |
||
3 | 3 | * Displays a list of all subscriptions rules |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
6 | +if ( ! defined( 'ABSPATH' ) ) { |
|
7 | + exit; |
|
8 | +} |
|
7 | 9 | |
8 | 10 | if ( ! class_exists( 'WP_List_Table' ) ) { |
9 | 11 | include_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
@@ -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 |