@@ -7,65 +7,65 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // MUST have WordPress. |
10 | -if ( !defined( 'WPINC' ) ) { |
|
11 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
10 | +if (!defined('WPINC')) { |
|
11 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
12 | 12 | } |
13 | 13 | |
14 | -function wpinv_bulk_actions( $actions ) { |
|
15 | - if ( isset( $actions['edit'] ) ) { |
|
16 | - unset( $actions['edit'] ); |
|
14 | +function wpinv_bulk_actions($actions) { |
|
15 | + if (isset($actions['edit'])) { |
|
16 | + unset($actions['edit']); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | return $actions; |
20 | 20 | } |
21 | -add_filter( 'bulk_actions-edit-wpi_invoice', 'wpinv_bulk_actions' ); |
|
22 | -add_filter( 'bulk_actions-edit-wpi_item', 'wpinv_bulk_actions' ); |
|
21 | +add_filter('bulk_actions-edit-wpi_invoice', 'wpinv_bulk_actions'); |
|
22 | +add_filter('bulk_actions-edit-wpi_item', 'wpinv_bulk_actions'); |
|
23 | 23 | |
24 | -function wpinv_admin_post_id( $id = 0 ) { |
|
24 | +function wpinv_admin_post_id($id = 0) { |
|
25 | 25 | global $post; |
26 | 26 | |
27 | - if ( isset( $id ) && ! empty( $id ) ) { |
|
28 | - return (int)$id; |
|
29 | - } else if ( get_the_ID() ) { |
|
27 | + if (isset($id) && !empty($id)) { |
|
28 | + return (int) $id; |
|
29 | + } else if (get_the_ID()) { |
|
30 | 30 | return (int) get_the_ID(); |
31 | - } else if ( isset( $post->ID ) && !empty( $post->ID ) ) { |
|
31 | + } else if (isset($post->ID) && !empty($post->ID)) { |
|
32 | 32 | return (int) $post->ID; |
33 | - } else if ( isset( $_GET['post'] ) && !empty( $_GET['post'] ) ) { |
|
33 | + } else if (isset($_GET['post']) && !empty($_GET['post'])) { |
|
34 | 34 | return (int) $_GET['post']; |
35 | - } else if ( isset( $_GET['id'] ) && !empty( $_GET['id'] ) ) { |
|
35 | + } else if (isset($_GET['id']) && !empty($_GET['id'])) { |
|
36 | 36 | return (int) $_GET['id']; |
37 | - } else if ( isset( $_POST['id'] ) && !empty( $_POST['id'] ) ) { |
|
37 | + } else if (isset($_POST['id']) && !empty($_POST['id'])) { |
|
38 | 38 | return (int) $_POST['id']; |
39 | 39 | } |
40 | 40 | |
41 | 41 | return null; |
42 | 42 | } |
43 | 43 | |
44 | -function wpinv_admin_post_type( $id = 0 ) { |
|
45 | - if ( !$id ) { |
|
44 | +function wpinv_admin_post_type($id = 0) { |
|
45 | + if (!$id) { |
|
46 | 46 | $id = wpinv_admin_post_id(); |
47 | 47 | } |
48 | 48 | |
49 | - $type = get_post_type( $id ); |
|
49 | + $type = get_post_type($id); |
|
50 | 50 | |
51 | - if ( !$type ) { |
|
52 | - $type = isset( $_GET['post_type'] ) && !empty( $_GET['post_type'] ) ? $_GET['post_type'] : null; |
|
51 | + if (!$type) { |
|
52 | + $type = isset($_GET['post_type']) && !empty($_GET['post_type']) ? $_GET['post_type'] : null; |
|
53 | 53 | } |
54 | 54 | |
55 | - return apply_filters( 'wpinv_admin_post_type', $type, $id ); |
|
55 | + return apply_filters('wpinv_admin_post_type', $type, $id); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | function wpinv_admin_messages() { |
59 | - settings_errors( 'wpinv-notices' ); |
|
59 | + settings_errors('wpinv-notices'); |
|
60 | 60 | } |
61 | -add_action( 'admin_notices', 'wpinv_admin_messages' ); |
|
61 | +add_action('admin_notices', 'wpinv_admin_messages'); |
|
62 | 62 | |
63 | -add_action( 'admin_init', 'wpinv_show_test_payment_gateway_notice' ); |
|
64 | -function wpinv_show_test_payment_gateway_notice(){ |
|
65 | - add_action( 'admin_notices', 'wpinv_test_payment_gateway_messages' ); |
|
63 | +add_action('admin_init', 'wpinv_show_test_payment_gateway_notice'); |
|
64 | +function wpinv_show_test_payment_gateway_notice() { |
|
65 | + add_action('admin_notices', 'wpinv_test_payment_gateway_messages'); |
|
66 | 66 | } |
67 | 67 | |
68 | -function wpinv_test_payment_gateway_messages(){ |
|
68 | +function wpinv_test_payment_gateway_messages() { |
|
69 | 69 | $gateways = wpinv_get_enabled_payment_gateways(); |
70 | 70 | $name = array(); $test_gateways = ''; |
71 | 71 | if ($gateways) { |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | } |
77 | 77 | $test_gateways = implode(', ', $name); |
78 | 78 | } |
79 | - if(isset($test_gateways) && !empty($test_gateways)){ |
|
79 | + if (isset($test_gateways) && !empty($test_gateways)) { |
|
80 | 80 | $link = admin_url('admin.php?page=wpinv-settings&tab=gateways'); |
81 | - $notice = wp_sprintf( __('<strong>Important:</strong> Payment Gateway(s) %s are in testing mode and will not receive real payments. Go to <a href="%s"> Gateway Settings</a>.', 'invoicing'), $test_gateways, $link ); |
|
81 | + $notice = wp_sprintf(__('<strong>Important:</strong> Payment Gateway(s) %s are in testing mode and will not receive real payments. Go to <a href="%s"> Gateway Settings</a>.', 'invoicing'), $test_gateways, $link); |
|
82 | 82 | ?> |
83 | 83 | <div class="notice notice-warning is-dismissible"> |
84 | 84 | <p><?php echo $notice; ?></p> |
@@ -95,29 +95,29 @@ discard block |
||
95 | 95 | global $wpdb; |
96 | 96 | |
97 | 97 | // Only do this on our settings page. |
98 | - if ( empty( $_GET[ 'page' ] ) || 'wpinv-settings' !== $_GET[ 'page' ] ) { |
|
98 | + if (empty($_GET['page']) || 'wpinv-settings' !== $_GET['page']) { |
|
99 | 99 | return; |
100 | 100 | } |
101 | 101 | |
102 | 102 | // Check tables. |
103 | - $tables = array( |
|
103 | + $tables = array( |
|
104 | 104 | "{$wpdb->prefix}wpinv_subscriptions", |
105 | 105 | "{$wpdb->prefix}getpaid_invoices", |
106 | 106 | "{$wpdb->prefix}getpaid_invoice_items", |
107 | 107 | ); |
108 | 108 | |
109 | - foreach ( $tables as $table ) { |
|
110 | - if ( $table != $wpdb->get_var( "SHOW TABLES LIKE '$table'" ) ) { |
|
109 | + foreach ($tables as $table) { |
|
110 | + if ($table != $wpdb->get_var("SHOW TABLES LIKE '$table'")) { |
|
111 | 111 | |
112 | - $url = esc_url( |
|
112 | + $url = esc_url( |
|
113 | 113 | wp_nonce_url( |
114 | - add_query_arg( 'getpaid-admin-action', 'create_missing_tables' ), |
|
114 | + add_query_arg('getpaid-admin-action', 'create_missing_tables'), |
|
115 | 115 | 'getpaid-nonce', |
116 | 116 | 'getpaid-nonce' |
117 | 117 | ) |
118 | 118 | ); |
119 | - $message = __( 'Some GetPaid database tables are missing. To use GetPaid without any issues, click on the button below to create the missing tables.', 'invoicing' ); |
|
120 | - $message2 = __( 'Create Tables', 'invoicing' ); |
|
119 | + $message = __('Some GetPaid database tables are missing. To use GetPaid without any issues, click on the button below to create the missing tables.', 'invoicing'); |
|
120 | + $message2 = __('Create Tables', 'invoicing'); |
|
121 | 121 | echo "<div class='notice notice-warning is-dismissible'><p>$message<br><br><a href='$url' class='button button-primary'>$message2</a></p></div>"; |
122 | 122 | break; |
123 | 123 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | } |
128 | -add_action( 'admin_notices', 'wpinv_check_for_missing_tables' ); |
|
128 | +add_action('admin_notices', 'wpinv_check_for_missing_tables'); |
|
129 | 129 | |
130 | 130 | add_action('admin_init', 'wpinv_admin_search_by_invoice'); |
131 | 131 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | function wpinv_admin_search_by_invoice() { |
136 | 136 | global $typenow; |
137 | 137 | |
138 | - if ($typenow === 'wpi_invoice' || $typenow === 'wpi_quote' ) { |
|
138 | + if ($typenow === 'wpi_invoice' || $typenow === 'wpi_quote') { |
|
139 | 139 | add_filter('posts_search', 'wpinv_posts_search_example_type', 10, 2); |
140 | 140 | } |
141 | 141 | } |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | global $wpdb; |
151 | 151 | |
152 | 152 | if ($query->is_main_query() && !empty($query->query['s'])) { |
153 | - $conditions_str = "{$wpdb->posts}.post_author IN ( SELECT ID FROM {$wpdb->users} WHERE user_email LIKE '%" . esc_sql( $query->query['s'] ) . "%' )"; |
|
154 | - if ( ! empty( $search ) ) { |
|
155 | - $search = preg_replace( '/^ AND /', '', $search ); |
|
153 | + $conditions_str = "{$wpdb->posts}.post_author IN ( SELECT ID FROM {$wpdb->users} WHERE user_email LIKE '%" . esc_sql($query->query['s']) . "%' )"; |
|
154 | + if (!empty($search)) { |
|
155 | + $search = preg_replace('/^ AND /', '', $search); |
|
156 | 156 | $search = " AND ( {$search} OR ( {$conditions_str} ) )"; |
157 | 157 | } else { |
158 | 158 | $search = " AND ( {$conditions_str} )"; |
@@ -165,14 +165,14 @@ discard block |
||
165 | 165 | /** |
166 | 166 | * Resets invoice counts. |
167 | 167 | */ |
168 | -function wpinv_reset_invoice_count(){ |
|
169 | - if ( ! empty( $_GET['reset_invoice_count'] ) && isset( $_GET['_nonce'] ) && wp_verify_nonce( $_GET['_nonce'], 'reset_invoice_count' ) ) { |
|
168 | +function wpinv_reset_invoice_count() { |
|
169 | + if (!empty($_GET['reset_invoice_count']) && isset($_GET['_nonce']) && wp_verify_nonce($_GET['_nonce'], 'reset_invoice_count')) { |
|
170 | 170 | wpinv_update_option('invoice_sequence_start', 1); |
171 | 171 | delete_option('wpinv_last_invoice_number'); |
172 | - getpaid_admin()->show_success( __( 'Invoice number sequence reset successfully.', 'invoicing' ) ); |
|
173 | - $url = remove_query_arg( array('reset_invoice_count', '_nonce') ); |
|
172 | + getpaid_admin()->show_success(__('Invoice number sequence reset successfully.', 'invoicing')); |
|
173 | + $url = remove_query_arg(array('reset_invoice_count', '_nonce')); |
|
174 | 174 | wp_redirect($url); |
175 | 175 | exit(); |
176 | 176 | } |
177 | 177 | } |
178 | -add_action( 'admin_init', 'wpinv_reset_invoice_count' ); |
|
179 | 178 | \ No newline at end of file |
179 | +add_action('admin_init', 'wpinv_reset_invoice_count'); |
|
180 | 180 | \ No newline at end of file |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package GetPaid |
7 | 7 | */ |
8 | 8 | |
9 | -defined( 'ABSPATH' ) || exit; |
|
9 | +defined('ABSPATH') || exit; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Generates a users select dropdown. |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | * @param array $args |
17 | 17 | * @see wp_dropdown_users |
18 | 18 | */ |
19 | -function wpinv_dropdown_users( $args = '' ) { |
|
19 | +function wpinv_dropdown_users($args = '') { |
|
20 | 20 | |
21 | - if ( is_array( $args ) && ! empty( $args['show'] ) && 'display_name_with_email' == $args['show'] ) { |
|
21 | + if (is_array($args) && !empty($args['show']) && 'display_name_with_email' == $args['show']) { |
|
22 | 22 | $args['show'] = 'display_name_with_login'; |
23 | 23 | } |
24 | 24 | |
25 | - return wp_dropdown_users( $args ); |
|
25 | + return wp_dropdown_users($args); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @return string capability to check against |
33 | 33 | * @param string $capalibilty Optional. The alternative capability to check against. |
34 | 34 | */ |
35 | -function wpinv_get_capability( $capalibilty = 'manage_invoicing' ) { |
|
35 | +function wpinv_get_capability($capalibilty = 'manage_invoicing') { |
|
36 | 36 | |
37 | - if ( current_user_can( 'manage_options' ) ) { |
|
37 | + if (current_user_can('manage_options')) { |
|
38 | 38 | return 'manage_options'; |
39 | 39 | }; |
40 | 40 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @return bool |
49 | 49 | */ |
50 | 50 | function wpinv_current_user_can_manage_invoicing() { |
51 | - return current_user_can( wpinv_get_capability() ); |
|
51 | + return current_user_can(wpinv_get_capability()); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -57,19 +57,19 @@ discard block |
||
57 | 57 | * @since 1.0.19 |
58 | 58 | * @return int|WP_Error |
59 | 59 | */ |
60 | -function wpinv_create_user( $email, $prefix = '' ) { |
|
60 | +function wpinv_create_user($email, $prefix = '') { |
|
61 | 61 | |
62 | 62 | // Prepare user values. |
63 | - $prefix = preg_replace( '/\s+/', '', $prefix ); |
|
64 | - $prefix = empty( $prefix ) ? $email : $prefix; |
|
65 | - $args = array( |
|
66 | - 'user_login' => wpinv_generate_user_name( $prefix ), |
|
63 | + $prefix = preg_replace('/\s+/', '', $prefix); |
|
64 | + $prefix = empty($prefix) ? $email : $prefix; |
|
65 | + $args = array( |
|
66 | + 'user_login' => wpinv_generate_user_name($prefix), |
|
67 | 67 | 'user_pass' => wp_generate_password(), |
68 | 68 | 'user_email' => $email, |
69 | 69 | 'role' => 'subscriber', |
70 | 70 | ); |
71 | 71 | |
72 | - return wp_insert_user( $args ); |
|
72 | + return wp_insert_user($args); |
|
73 | 73 | |
74 | 74 | } |
75 | 75 | |
@@ -79,26 +79,26 @@ discard block |
||
79 | 79 | * @since 1.0.19 |
80 | 80 | * @return bool|WP_User |
81 | 81 | */ |
82 | -function wpinv_generate_user_name( $prefix = '' ) { |
|
82 | +function wpinv_generate_user_name($prefix = '') { |
|
83 | 83 | |
84 | 84 | // If prefix is an email, retrieve the part before the email. |
85 | - $prefix = strtok( $prefix, '@' ); |
|
86 | - $prefix = trim( $prefix, '.' ); |
|
85 | + $prefix = strtok($prefix, '@'); |
|
86 | + $prefix = trim($prefix, '.'); |
|
87 | 87 | |
88 | 88 | // Sanitize the username. |
89 | - $prefix = sanitize_user( $prefix, true ); |
|
89 | + $prefix = sanitize_user($prefix, true); |
|
90 | 90 | |
91 | - $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() ); |
|
92 | - if ( empty( $prefix ) || in_array( strtolower( $prefix ), array_map( 'strtolower', $illegal_logins ), true ) ) { |
|
93 | - $prefix = 'gtp_' . zeroise( wp_rand( 0, 9999 ), 4 ); |
|
91 | + $illegal_logins = (array) apply_filters('illegal_user_logins', array()); |
|
92 | + if (empty($prefix) || in_array(strtolower($prefix), array_map('strtolower', $illegal_logins), true)) { |
|
93 | + $prefix = 'gtp_' . zeroise(wp_rand(0, 9999), 4); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | $username = $prefix; |
97 | 97 | $postfix = 2; |
98 | 98 | |
99 | - while ( username_exists( $username ) ) { |
|
99 | + while (username_exists($username)) { |
|
100 | 100 | $username = $prefix + $postfix; |
101 | - $postfix ++; |
|
101 | + $postfix++; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | return $username; |
@@ -115,31 +115,31 @@ discard block |
||
115 | 115 | $tabs = array( |
116 | 116 | |
117 | 117 | 'gp-invoices' => array( |
118 | - 'label' => __( 'Invoices', 'invoicing' ), // Name of the tab. |
|
118 | + 'label' => __('Invoices', 'invoicing'), // Name of the tab. |
|
119 | 119 | 'content' => '[wpinv_history]', // Content of the tab. Or specify "callback" to provide a callback instead. |
120 | 120 | 'icon' => 'fas fa-file-invoice', // Shown on some profile plugins. |
121 | 121 | ), |
122 | 122 | |
123 | 123 | 'gp-subscriptions' => array( |
124 | - 'label' => __( 'Subscriptions', 'invoicing' ), |
|
124 | + 'label' => __('Subscriptions', 'invoicing'), |
|
125 | 125 | 'content' => '[wpinv_subscriptions]', |
126 | 126 | 'icon' => 'fas fa-redo', |
127 | 127 | ), |
128 | 128 | |
129 | 129 | 'gp-edit-address' => array( |
130 | - 'label' => __( 'Billing Address', 'invoicing' ), |
|
130 | + 'label' => __('Billing Address', 'invoicing'), |
|
131 | 131 | 'callback' => 'getpaid_display_address_edit_tab', |
132 | 132 | 'icon' => 'fas fa-credit-card', |
133 | 133 | ), |
134 | 134 | |
135 | 135 | ); |
136 | 136 | |
137 | - $tabs = apply_filters( 'getpaid_user_content_tabs', $tabs ); |
|
137 | + $tabs = apply_filters('getpaid_user_content_tabs', $tabs); |
|
138 | 138 | |
139 | 139 | // Make sure address editing is last on the list. |
140 | - if ( isset( $tabs['gp-edit-address'] ) ) { |
|
140 | + if (isset($tabs['gp-edit-address'])) { |
|
141 | 141 | $address = $tabs['gp-edit-address']; |
142 | - unset( $tabs['gp-edit-address'] ); |
|
142 | + unset($tabs['gp-edit-address']); |
|
143 | 143 | $tabs['gp-edit-address'] = $address; |
144 | 144 | } |
145 | 145 | |
@@ -153,19 +153,19 @@ discard block |
||
153 | 153 | * @param array $tab |
154 | 154 | * @return array |
155 | 155 | */ |
156 | -function getpaid_prepare_user_content_tab( $tab ) { |
|
156 | +function getpaid_prepare_user_content_tab($tab) { |
|
157 | 157 | |
158 | - if ( ! empty( $tab['callback'] ) ) { |
|
159 | - return call_user_func( $tab['callback'] ); |
|
158 | + if (!empty($tab['callback'])) { |
|
159 | + return call_user_func($tab['callback']); |
|
160 | 160 | } |
161 | 161 | |
162 | - if ( ! empty( $tab['content'] ) ) { |
|
163 | - return convert_smilies( capital_P_dangit( wp_filter_content_tags( do_shortcode( shortcode_unautop( wpautop( wptexturize( do_blocks( $tab['content'] ) ) ) ) ) ) ) ); |
|
162 | + if (!empty($tab['content'])) { |
|
163 | + return convert_smilies(capital_P_dangit(wp_filter_content_tags(do_shortcode(shortcode_unautop(wpautop(wptexturize(do_blocks($tab['content'])))))))); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | $notice = aui()->alert( |
167 | 167 | array( |
168 | - 'content' => __( 'This tab has no content or content callback.', 'invoicing' ), |
|
168 | + 'content' => __('This tab has no content or content callback.', 'invoicing'), |
|
169 | 169 | 'type' => 'error', |
170 | 170 | ) |
171 | 171 | ); |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | * @param string $default |
182 | 182 | * @return array |
183 | 183 | */ |
184 | -function getpaid_get_tab_url( $tab, $default ) { |
|
184 | +function getpaid_get_tab_url($tab, $default) { |
|
185 | 185 | global $getpaid_tab_url; |
186 | 186 | |
187 | - if ( empty( $getpaid_tab_url ) ) { |
|
187 | + if (empty($getpaid_tab_url)) { |
|
188 | 188 | return $default; |
189 | 189 | } |
190 | 190 | |
191 | - return sprintf( $getpaid_tab_url, $tab ); |
|
191 | + return sprintf($getpaid_tab_url, $tab); |
|
192 | 192 | |
193 | 193 | } |
194 | 194 | |
@@ -208,19 +208,19 @@ discard block |
||
208 | 208 | |
209 | 209 | <?php |
210 | 210 | |
211 | - foreach ( getpaid_user_address_fields() as $key => $label ) { |
|
211 | + foreach (getpaid_user_address_fields() as $key => $label) { |
|
212 | 212 | |
213 | 213 | // Display the country. |
214 | - if ( 'country' == $key ) { |
|
214 | + if ('country' == $key) { |
|
215 | 215 | |
216 | 216 | echo aui()->select( |
217 | 217 | array( |
218 | 218 | 'options' => wpinv_get_country_list(), |
219 | - 'name' => esc_attr( $key ), |
|
220 | - 'id' => 'wpinv-' . sanitize_html_class( $key ), |
|
221 | - 'value' => sanitize_text_field( getpaid_get_user_address_field( get_current_user_id(), $key ) ), |
|
219 | + 'name' => esc_attr($key), |
|
220 | + 'id' => 'wpinv-' . sanitize_html_class($key), |
|
221 | + 'value' => sanitize_text_field(getpaid_get_user_address_field(get_current_user_id(), $key)), |
|
222 | 222 | 'placeholder' => $label, |
223 | - 'label' => wp_kses_post( $label ), |
|
223 | + 'label' => wp_kses_post($label), |
|
224 | 224 | 'label_type' => 'vertical', |
225 | 225 | 'class' => 'getpaid-address-field', |
226 | 226 | ) |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | // Display the state. |
232 | - else if ( 'state' == $key ) { |
|
232 | + else if ('state' == $key) { |
|
233 | 233 | |
234 | - echo getpaid_get_states_select_markup ( |
|
235 | - getpaid_get_user_address_field( get_current_user_id(), 'country' ), |
|
236 | - getpaid_get_user_address_field( get_current_user_id(), 'state' ), |
|
234 | + echo getpaid_get_states_select_markup( |
|
235 | + getpaid_get_user_address_field(get_current_user_id(), 'country'), |
|
236 | + getpaid_get_user_address_field(get_current_user_id(), 'state'), |
|
237 | 237 | $label, |
238 | 238 | $label, |
239 | 239 | '', |
@@ -246,13 +246,13 @@ discard block |
||
246 | 246 | |
247 | 247 | echo aui()->input( |
248 | 248 | array( |
249 | - 'name' => esc_attr( $key ), |
|
250 | - 'id' => 'wpinv-' . sanitize_html_class( $key ), |
|
249 | + 'name' => esc_attr($key), |
|
250 | + 'id' => 'wpinv-' . sanitize_html_class($key), |
|
251 | 251 | 'placeholder' => $label, |
252 | - 'label' => wp_kses_post( $label ), |
|
252 | + 'label' => wp_kses_post($label), |
|
253 | 253 | 'label_type' => 'vertical', |
254 | 254 | 'type' => 'text', |
255 | - 'value' => sanitize_text_field( getpaid_get_user_address_field( get_current_user_id(), $key ) ), |
|
255 | + 'value' => sanitize_text_field(getpaid_get_user_address_field(get_current_user_id(), $key)), |
|
256 | 256 | 'class' => 'getpaid-address-field', |
257 | 257 | ) |
258 | 258 | ); |
@@ -261,21 +261,21 @@ discard block |
||
261 | 261 | |
262 | 262 | } |
263 | 263 | |
264 | - do_action( 'getpaid_display_address_edit_tab' ); |
|
264 | + do_action('getpaid_display_address_edit_tab'); |
|
265 | 265 | |
266 | 266 | echo aui()->input( |
267 | 267 | array( |
268 | 268 | 'name' => 'getpaid_profile_edit_submit_button', |
269 | 269 | 'id' => 'getpaid_profile_edit_submit_button', |
270 | - 'value' => __( 'Save Address', 'invoicing' ), |
|
271 | - 'help_text' => __( 'New invoices will use this address as the billing address.', 'invoicing' ), |
|
270 | + 'value' => __('Save Address', 'invoicing'), |
|
271 | + 'help_text' => __('New invoices will use this address as the billing address.', 'invoicing'), |
|
272 | 272 | 'type' => 'submit', |
273 | 273 | 'class' => 'btn btn-primary btn-block submit-button', |
274 | 274 | ) |
275 | 275 | ); |
276 | 276 | |
277 | - wp_nonce_field( 'getpaid-nonce', 'getpaid-nonce' ); |
|
278 | - getpaid_hidden_field( 'getpaid-action', 'edit_billing_details' ); |
|
277 | + wp_nonce_field('getpaid-nonce', 'getpaid-nonce'); |
|
278 | + getpaid_hidden_field('getpaid-action', 'edit_billing_details'); |
|
279 | 279 | ?> |
280 | 280 | |
281 | 281 | </form> |
@@ -292,20 +292,20 @@ discard block |
||
292 | 292 | * @since 2.1.4 |
293 | 293 | * @param array $data |
294 | 294 | */ |
295 | -function getpaid_save_address_edit_tab( $data ) { |
|
295 | +function getpaid_save_address_edit_tab($data) { |
|
296 | 296 | |
297 | - foreach ( array_keys( getpaid_user_address_fields() ) as $field ) { |
|
297 | + foreach (array_keys(getpaid_user_address_fields()) as $field) { |
|
298 | 298 | |
299 | - if ( isset( $data[ $field ] ) ) { |
|
300 | - $value = sanitize_text_field( $data[ $field ] ); |
|
301 | - update_user_meta( get_current_user_id(), '_wpinv_' . $field, $value ); |
|
299 | + if (isset($data[$field])) { |
|
300 | + $value = sanitize_text_field($data[$field]); |
|
301 | + update_user_meta(get_current_user_id(), '_wpinv_' . $field, $value); |
|
302 | 302 | } |
303 | 303 | |
304 | - wpinv_set_error( 'address_updated', __( 'You billing address has been updated', 'invoicing' ), 'success'); |
|
304 | + wpinv_set_error('address_updated', __('You billing address has been updated', 'invoicing'), 'success'); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | } |
308 | -add_action( 'getpaid_authenticated_action_edit_billing_details', 'getpaid_save_address_edit_tab' ); |
|
308 | +add_action('getpaid_authenticated_action_edit_billing_details', 'getpaid_save_address_edit_tab'); |
|
309 | 309 | |
310 | 310 | |
311 | 311 | /* |
@@ -323,27 +323,27 @@ discard block |
||
323 | 323 | * @param array $tabs |
324 | 324 | * @return array |
325 | 325 | */ |
326 | -function getpaid_filter_userswp_account_tabs( $tabs ) { |
|
326 | +function getpaid_filter_userswp_account_tabs($tabs) { |
|
327 | 327 | |
328 | 328 | // Abort if the integration is inactive. |
329 | - if ( ! getpaid_is_userswp_integration_active() ) { |
|
329 | + if (!getpaid_is_userswp_integration_active()) { |
|
330 | 330 | return $tabs; |
331 | 331 | } |
332 | 332 | |
333 | - $new_tabs = array(); |
|
333 | + $new_tabs = array(); |
|
334 | 334 | |
335 | - foreach ( getpaid_get_user_content_tabs() as $slug => $tab ) { |
|
335 | + foreach (getpaid_get_user_content_tabs() as $slug => $tab) { |
|
336 | 336 | |
337 | - $new_tabs[ $slug ] = array( |
|
338 | - 'title' => $tab[ 'label'], |
|
339 | - 'icon' => $tab[ 'icon'], |
|
337 | + $new_tabs[$slug] = array( |
|
338 | + 'title' => $tab['label'], |
|
339 | + 'icon' => $tab['icon'], |
|
340 | 340 | ); |
341 | 341 | |
342 | 342 | } |
343 | 343 | |
344 | - return array_merge( $tabs, $new_tabs ); |
|
344 | + return array_merge($tabs, $new_tabs); |
|
345 | 345 | } |
346 | -add_filter( 'uwp_account_available_tabs', 'getpaid_filter_userswp_account_tabs' ); |
|
346 | +add_filter('uwp_account_available_tabs', 'getpaid_filter_userswp_account_tabs'); |
|
347 | 347 | |
348 | 348 | /** |
349 | 349 | * Display our UsersWP account tabs. |
@@ -352,18 +352,18 @@ discard block |
||
352 | 352 | * @param array $tabs |
353 | 353 | * @return array |
354 | 354 | */ |
355 | -function getpaid_display_userswp_account_tabs( $tab ) { |
|
355 | +function getpaid_display_userswp_account_tabs($tab) { |
|
356 | 356 | global $getpaid_tab_url; |
357 | 357 | |
358 | 358 | $our_tabs = getpaid_get_user_content_tabs(); |
359 | 359 | |
360 | - if ( getpaid_is_userswp_integration_active() && isset( $our_tabs[ $tab ] ) ) { |
|
361 | - $getpaid_tab_url = add_query_arg( 'type', '%s', uwp_get_account_page_url() ); |
|
362 | - echo getpaid_prepare_user_content_tab( $our_tabs[ $tab ] ); |
|
360 | + if (getpaid_is_userswp_integration_active() && isset($our_tabs[$tab])) { |
|
361 | + $getpaid_tab_url = add_query_arg('type', '%s', uwp_get_account_page_url()); |
|
362 | + echo getpaid_prepare_user_content_tab($our_tabs[$tab]); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | } |
366 | -add_action( 'uwp_account_form_display', 'getpaid_display_userswp_account_tabs' ); |
|
366 | +add_action('uwp_account_form_display', 'getpaid_display_userswp_account_tabs'); |
|
367 | 367 | |
368 | 368 | |
369 | 369 | /** |
@@ -374,17 +374,17 @@ discard block |
||
374 | 374 | * @param string $tab Current tab. |
375 | 375 | * @return string Title. |
376 | 376 | */ |
377 | -function getpaid_filter_userswp_account_title( $title, $tab ) { |
|
377 | +function getpaid_filter_userswp_account_title($title, $tab) { |
|
378 | 378 | |
379 | - $our_tabs = getpaid_get_user_content_tabs(); |
|
379 | + $our_tabs = getpaid_get_user_content_tabs(); |
|
380 | 380 | |
381 | - if ( getpaid_is_userswp_integration_active() && isset( $our_tabs[ $tab ] ) ) { |
|
382 | - return $our_tabs[ $tab ]['label']; |
|
381 | + if (getpaid_is_userswp_integration_active() && isset($our_tabs[$tab])) { |
|
382 | + return $our_tabs[$tab]['label']; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | return $title; |
386 | 386 | } |
387 | -add_filter( 'uwp_account_page_title', 'getpaid_filter_userswp_account_title', 10, 2 ); |
|
387 | +add_filter('uwp_account_page_title', 'getpaid_filter_userswp_account_title', 10, 2); |
|
388 | 388 | |
389 | 389 | /** |
390 | 390 | * Registers the UsersWP integration settings. |
@@ -393,26 +393,26 @@ discard block |
||
393 | 393 | * @param array $settings An array of integration settings. |
394 | 394 | * @return array |
395 | 395 | */ |
396 | -function getpaid_register_userswp_settings( $settings ) { |
|
396 | +function getpaid_register_userswp_settings($settings) { |
|
397 | 397 | |
398 | - if ( defined( 'USERSWP_PLUGIN_FILE' ) ) { |
|
398 | + if (defined('USERSWP_PLUGIN_FILE')) { |
|
399 | 399 | |
400 | 400 | $settings[] = array( |
401 | 401 | |
402 | 402 | 'id' => 'userswp', |
403 | - 'label' => __( 'UsersWP', 'invoicing' ), |
|
403 | + 'label' => __('UsersWP', 'invoicing'), |
|
404 | 404 | 'settings' => array( |
405 | 405 | |
406 | 406 | 'userswp_settings' => array( |
407 | 407 | 'id' => 'userswp_settings', |
408 | - 'name' => '<h3>' . __( 'UsersWP', 'invoicing' ) . '</h3>', |
|
408 | + 'name' => '<h3>' . __('UsersWP', 'invoicing') . '</h3>', |
|
409 | 409 | 'type' => 'header', |
410 | 410 | ), |
411 | 411 | |
412 | 412 | 'enable_userswp' => array( |
413 | 413 | 'id' => 'enable_userswp', |
414 | - 'name' => __( 'Enable Integration', 'invoicing' ), |
|
415 | - 'desc' => __( 'Display GetPaid items on UsersWP account page.', 'invoicing' ), |
|
414 | + 'name' => __('Enable Integration', 'invoicing'), |
|
415 | + 'desc' => __('Display GetPaid items on UsersWP account page.', 'invoicing'), |
|
416 | 416 | 'type' => 'checkbox', |
417 | 417 | 'std' => 1, |
418 | 418 | ) |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | |
426 | 426 | return $settings; |
427 | 427 | } |
428 | -add_filter( 'getpaid_integration_settings', 'getpaid_register_userswp_settings' ); |
|
428 | +add_filter('getpaid_integration_settings', 'getpaid_register_userswp_settings'); |
|
429 | 429 | |
430 | 430 | /** |
431 | 431 | * Checks if the integration is enabled. |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | * @return bool |
435 | 435 | */ |
436 | 436 | function getpaid_is_userswp_integration_active() { |
437 | - $enabled = wpinv_get_option( 'enable_userswp', 1 ); |
|
438 | - return defined( 'USERSWP_PLUGIN_FILE' ) && ! empty( $enabled ); |
|
437 | + $enabled = wpinv_get_option('enable_userswp', 1); |
|
438 | + return defined('USERSWP_PLUGIN_FILE') && !empty($enabled); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | /* |
@@ -453,26 +453,26 @@ discard block |
||
453 | 453 | * @param array $settings An array of integration settings. |
454 | 454 | * @return array |
455 | 455 | */ |
456 | -function getpaid_register_buddypress_settings( $settings ) { |
|
456 | +function getpaid_register_buddypress_settings($settings) { |
|
457 | 457 | |
458 | - if ( class_exists( 'BuddyPress' ) ) { |
|
458 | + if (class_exists('BuddyPress')) { |
|
459 | 459 | |
460 | 460 | $settings[] = array( |
461 | 461 | |
462 | 462 | 'id' => 'buddypress', |
463 | - 'label' => __( 'BuddyPress', 'invoicing' ), |
|
463 | + 'label' => __('BuddyPress', 'invoicing'), |
|
464 | 464 | 'settings' => array( |
465 | 465 | |
466 | 466 | 'buddypress_settings' => array( |
467 | 467 | 'id' => 'buddypress_settings', |
468 | - 'name' => '<h3>' . __( 'BuddyPress', 'invoicing' ) . '</h3>', |
|
468 | + 'name' => '<h3>' . __('BuddyPress', 'invoicing') . '</h3>', |
|
469 | 469 | 'type' => 'header', |
470 | 470 | ), |
471 | 471 | |
472 | 472 | 'enable_buddypress' => array( |
473 | 473 | 'id' => 'enable_buddypress', |
474 | - 'name' => __( 'Enable Integration', 'invoicing' ), |
|
475 | - 'desc' => __( 'Display GetPaid items on BuddyPress account pages.', 'invoicing' ), |
|
474 | + 'name' => __('Enable Integration', 'invoicing'), |
|
475 | + 'desc' => __('Display GetPaid items on BuddyPress account pages.', 'invoicing'), |
|
476 | 476 | 'type' => 'checkbox', |
477 | 477 | 'std' => 1, |
478 | 478 | ) |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | |
486 | 486 | return $settings; |
487 | 487 | } |
488 | -add_filter( 'getpaid_integration_settings', 'getpaid_register_buddypress_settings' ); |
|
488 | +add_filter('getpaid_integration_settings', 'getpaid_register_buddypress_settings'); |
|
489 | 489 | |
490 | 490 | /** |
491 | 491 | * Checks if the integration is enabled. |
@@ -494,8 +494,8 @@ discard block |
||
494 | 494 | * @return bool |
495 | 495 | */ |
496 | 496 | function getpaid_is_buddypress_integration_active() { |
497 | - $enabled = wpinv_get_option( 'enable_buddypress', 1 ); |
|
498 | - return class_exists( 'BuddyPress' ) && ! empty( $enabled ); |
|
497 | + $enabled = wpinv_get_option('enable_buddypress', 1); |
|
498 | + return class_exists('BuddyPress') && !empty($enabled); |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
@@ -506,10 +506,10 @@ discard block |
||
506 | 506 | */ |
507 | 507 | function getpaid_setup_buddypress_integration() { |
508 | 508 | |
509 | - if ( getpaid_is_buddypress_integration_active() ) { |
|
510 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-bp-getpaid-component.php' ); |
|
509 | + if (getpaid_is_buddypress_integration_active()) { |
|
510 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-bp-getpaid-component.php'); |
|
511 | 511 | buddypress()->getpaid = new BP_GetPaid_Component(); |
512 | 512 | } |
513 | 513 | |
514 | 514 | } |
515 | -add_action( 'bp_setup_components', 'getpaid_setup_buddypress_integration' ); |
|
515 | +add_action('bp_setup_components', 'getpaid_setup_buddypress_integration'); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @version 1.0.19 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | return array( |
14 | 14 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | 'global' => true, |
19 | 19 | 'rate' => 20, |
20 | 20 | 'reduced_rate' => 13, |
21 | - 'name' => __( 'VAT', 'invoicing' ), |
|
21 | + 'name' => __('VAT', 'invoicing'), |
|
22 | 22 | ), |
23 | 23 | |
24 | 24 | array( |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | 'global' => true, |
28 | 28 | 'rate' => 21, |
29 | 29 | 'reduced_rate' => 12, |
30 | - 'name' => __( 'VAT', 'invoicing' ), |
|
30 | + 'name' => __('VAT', 'invoicing'), |
|
31 | 31 | ), |
32 | 32 | |
33 | 33 | array( |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | 'global' => true, |
37 | 37 | 'rate' => 20, |
38 | 38 | 'reduced_rate' => 9, |
39 | - 'name' => __( 'VAT', 'invoicing' ), |
|
39 | + 'name' => __('VAT', 'invoicing'), |
|
40 | 40 | ), |
41 | 41 | |
42 | 42 | array( |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'global' => true, |
46 | 46 | 'rate' => 19, |
47 | 47 | 'reduced_rate' => 9, |
48 | - 'name' => __( 'VAT', 'invoicing' ), |
|
48 | + 'name' => __('VAT', 'invoicing'), |
|
49 | 49 | ), |
50 | 50 | |
51 | 51 | array( |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'global' => true, |
55 | 55 | 'rate' => 21, |
56 | 56 | 'reduced_rate' => 15, |
57 | - 'name' => __( 'VAT', 'invoicing' ), |
|
57 | + 'name' => __('VAT', 'invoicing'), |
|
58 | 58 | ), |
59 | 59 | |
60 | 60 | array( |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | 'global' => true, |
64 | 64 | 'rate' => 25, |
65 | 65 | 'reduced_rate' => 25, |
66 | - 'name' => __( 'VAT', 'invoicing' ), |
|
66 | + 'name' => __('VAT', 'invoicing'), |
|
67 | 67 | ), |
68 | 68 | |
69 | 69 | array( |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'global' => true, |
73 | 73 | 'rate' => 16, |
74 | 74 | 'reduced_rate' => 5, |
75 | - 'name' => __( 'VAT', 'invoicing' ), |
|
75 | + 'name' => __('VAT', 'invoicing'), |
|
76 | 76 | ), |
77 | 77 | |
78 | 78 | array( |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 'global' => true, |
82 | 82 | 'rate' => 20, |
83 | 83 | 'reduced_rate' => 9, |
84 | - 'name' => __( 'VAT', 'invoicing' ), |
|
84 | + 'name' => __('VAT', 'invoicing'), |
|
85 | 85 | ), |
86 | 86 | |
87 | 87 | array( |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'global' => true, |
91 | 91 | 'rate' => 24, |
92 | 92 | 'reduced_rate' => 13, |
93 | - 'name' => __( 'VAT', 'invoicing' ), |
|
93 | + 'name' => __('VAT', 'invoicing'), |
|
94 | 94 | ), |
95 | 95 | |
96 | 96 | array( |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | 'global' => true, |
100 | 100 | 'rate' => 21, |
101 | 101 | 'reduced_rate' => 10, |
102 | - 'name' => __( 'VAT', 'invoicing' ), |
|
102 | + 'name' => __('VAT', 'invoicing'), |
|
103 | 103 | ), |
104 | 104 | |
105 | 105 | array( |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | 'global' => true, |
109 | 109 | 'rate' => 24, |
110 | 110 | 'reduced_rate' => 14, |
111 | - 'name' => __( 'VAT', 'invoicing' ), |
|
111 | + 'name' => __('VAT', 'invoicing'), |
|
112 | 112 | ), |
113 | 113 | |
114 | 114 | array( |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | 'global' => true, |
118 | 118 | 'rate' => 20, |
119 | 119 | 'reduced_rate' => 10, |
120 | - 'name' => __( 'VAT', 'invoicing' ), |
|
120 | + 'name' => __('VAT', 'invoicing'), |
|
121 | 121 | ), |
122 | 122 | |
123 | 123 | array( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | 'global' => true, |
127 | 127 | 'rate' => 25, |
128 | 128 | 'reduced_rate' => 13, |
129 | - 'name' => __( 'VAT', 'invoicing' ), |
|
129 | + 'name' => __('VAT', 'invoicing'), |
|
130 | 130 | ), |
131 | 131 | |
132 | 132 | array( |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | 'global' => true, |
136 | 136 | 'rate' => 22, |
137 | 137 | 'reduced_rate' => 10, |
138 | - 'name' => __( 'VAT', 'invoicing' ), |
|
138 | + 'name' => __('VAT', 'invoicing'), |
|
139 | 139 | ), |
140 | 140 | |
141 | 141 | array( |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | 'global' => true, |
145 | 145 | 'rate' => 21, |
146 | 146 | 'reduced_rate' => 12, |
147 | - 'name' => __( 'VAT', 'invoicing' ), |
|
147 | + 'name' => __('VAT', 'invoicing'), |
|
148 | 148 | ), |
149 | 149 | |
150 | 150 | array( |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | 'global' => true, |
154 | 154 | 'rate' => 21, |
155 | 155 | 'reduced_rate' => 9, |
156 | - 'name' => __( 'VAT', 'invoicing' ), |
|
156 | + 'name' => __('VAT', 'invoicing'), |
|
157 | 157 | ), |
158 | 158 | |
159 | 159 | array( |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'global' => true, |
163 | 163 | 'rate' => 17, |
164 | 164 | 'reduced_rate' => 14, |
165 | - 'name' => __( 'VAT', 'invoicing' ), |
|
165 | + 'name' => __('VAT', 'invoicing'), |
|
166 | 166 | ), |
167 | 167 | |
168 | 168 | array( |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | 'global' => true, |
172 | 172 | 'rate' => 27, |
173 | 173 | 'reduced_rate' => 18, |
174 | - 'name' => __( 'VAT', 'invoicing' ), |
|
174 | + 'name' => __('VAT', 'invoicing'), |
|
175 | 175 | ), |
176 | 176 | |
177 | 177 | array( |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | 'global' => true, |
181 | 181 | 'rate' => 21, |
182 | 182 | 'reduced_rate' => 13.5, |
183 | - 'name' => __( 'VAT', 'invoicing' ), |
|
183 | + 'name' => __('VAT', 'invoicing'), |
|
184 | 184 | ), |
185 | 185 | |
186 | 186 | array( |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | 'global' => true, |
190 | 190 | 'rate' => 18, |
191 | 191 | 'reduced_rate' => 7, |
192 | - 'name' => __( 'VAT', 'invoicing' ), |
|
192 | + 'name' => __('VAT', 'invoicing'), |
|
193 | 193 | ), |
194 | 194 | |
195 | 195 | array( |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | 'global' => true, |
199 | 199 | 'rate' => 21, |
200 | 200 | 'reduced_rate' => 9, |
201 | - 'name' => __( 'VAT', 'invoicing' ), |
|
201 | + 'name' => __('VAT', 'invoicing'), |
|
202 | 202 | ), |
203 | 203 | |
204 | 204 | array( |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | 'global' => true, |
208 | 208 | 'rate' => 23, |
209 | 209 | 'reduced_rate' => 8, |
210 | - 'name' => __( 'VAT', 'invoicing' ), |
|
210 | + 'name' => __('VAT', 'invoicing'), |
|
211 | 211 | ), |
212 | 212 | |
213 | 213 | array( |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | 'global' => true, |
217 | 217 | 'rate' => 23, |
218 | 218 | 'reduced_rate' => 13, |
219 | - 'name' => __( 'VAT', 'invoicing' ), |
|
219 | + 'name' => __('VAT', 'invoicing'), |
|
220 | 220 | ), |
221 | 221 | |
222 | 222 | array( |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | 'global' => true, |
226 | 226 | 'rate' => 19, |
227 | 227 | 'reduced_rate' => 9, |
228 | - 'name' => __( 'VAT', 'invoicing' ), |
|
228 | + 'name' => __('VAT', 'invoicing'), |
|
229 | 229 | ), |
230 | 230 | |
231 | 231 | array( |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | 'global' => true, |
235 | 235 | 'rate' => 22, |
236 | 236 | 'reduced_rate' => 9.5, |
237 | - 'name' => __( 'VAT', 'invoicing' ), |
|
237 | + 'name' => __('VAT', 'invoicing'), |
|
238 | 238 | ), |
239 | 239 | |
240 | 240 | array( |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | 'global' => true, |
244 | 244 | 'rate' => 20, |
245 | 245 | 'reduced_rate' => 10, |
246 | - 'name' => __( 'VAT', 'invoicing' ), |
|
246 | + 'name' => __('VAT', 'invoicing'), |
|
247 | 247 | ), |
248 | 248 | |
249 | 249 | array( |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | 'global' => true, |
253 | 253 | 'rate' => 25, |
254 | 254 | 'reduced_rate' => 12, |
255 | - 'name' => __( 'VAT', 'invoicing' ), |
|
255 | + 'name' => __('VAT', 'invoicing'), |
|
256 | 256 | ), |
257 | 257 | |
258 | 258 | array( |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | 'global' => true, |
262 | 262 | 'rate' => 20, |
263 | 263 | 'reduced_rate' => 5, |
264 | - 'name' => __( 'VAT', 'invoicing' ), |
|
264 | + 'name' => __('VAT', 'invoicing'), |
|
265 | 265 | ) |
266 | 266 | |
267 | 267 | ); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | // Exit if accessed directly. |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | /** |
14 | 14 | * Main GetPaid Class. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @type array $meta_tables Optional. An array of metadata table names. |
56 | 56 | * } |
57 | 57 | */ |
58 | - public function setup_globals( $args = array() ) { |
|
58 | + public function setup_globals($args = array()) { |
|
59 | 59 | parent::setup_globals( |
60 | 60 | array( |
61 | 61 | 'id' => 'getpaid', |
@@ -76,29 +76,29 @@ discard block |
||
76 | 76 | * @param array $main_nav Optional. See BP_Component::setup_nav() for description. |
77 | 77 | * @param array $sub_nav Optional. See BP_Component::setup_nav() for description. |
78 | 78 | */ |
79 | - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { |
|
79 | + public function setup_nav($main_nav = array(), $sub_nav = array()) { |
|
80 | 80 | |
81 | 81 | // Abort if the integration is inactive. |
82 | - if ( ! getpaid_is_buddypress_integration_active() || ! is_user_logged_in() ) { |
|
82 | + if (!getpaid_is_buddypress_integration_active() || !is_user_logged_in()) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
86 | 86 | // Or a user is not viewing their profile. |
87 | - if ( bp_displayed_user_id() != bp_loggedin_user_id() ) { |
|
87 | + if (bp_displayed_user_id() != bp_loggedin_user_id()) { |
|
88 | 88 | return; |
89 | 89 | } |
90 | 90 | |
91 | 91 | // Determine user to use. |
92 | 92 | $user_domain = bp_loggedin_user_domain(); |
93 | 93 | $slug = 'getpaid'; |
94 | - $payments_link = trailingslashit( $user_domain . $slug ); |
|
94 | + $payments_link = trailingslashit($user_domain . $slug); |
|
95 | 95 | |
96 | 96 | // Add 'Payments' to the main navigation. |
97 | 97 | $main_nav = array( |
98 | - 'name' => _x( 'Billing', 'BuddyPress profile payments screen nav', 'invoicing' ), |
|
98 | + 'name' => _x('Billing', 'BuddyPress profile payments screen nav', 'invoicing'), |
|
99 | 99 | 'slug' => $slug, |
100 | - 'position' => apply_filters( 'wpinv_bp_nav_position', wpinv_get_option( 'wpinv_menu_position', 91 ), $slug ), |
|
101 | - 'screen_function' => array( $this, 'display_current_tab' ), |
|
100 | + 'position' => apply_filters('wpinv_bp_nav_position', wpinv_get_option('wpinv_menu_position', 91), $slug), |
|
101 | + 'screen_function' => array($this, 'display_current_tab'), |
|
102 | 102 | 'default_subnav_slug' => 'gp-edit-address', |
103 | 103 | 'show_for_displayed_user' => false, |
104 | 104 | 'item_css_id' => $this->id, |
@@ -107,15 +107,15 @@ discard block |
||
107 | 107 | ); |
108 | 108 | |
109 | 109 | // Add the subnav items to the payments nav item if we are using a theme that supports this. |
110 | - foreach ( getpaid_get_user_content_tabs() as $_slug => $tab ) { |
|
110 | + foreach (getpaid_get_user_content_tabs() as $_slug => $tab) { |
|
111 | 111 | |
112 | 112 | $sub_nav[] = array( |
113 | - 'name' => $tab[ 'label'], |
|
113 | + 'name' => $tab['label'], |
|
114 | 114 | 'slug' => $_slug, |
115 | 115 | 'parent_url' => $payments_link, |
116 | 116 | 'parent_slug' => $slug, |
117 | 117 | 'position' => 10, |
118 | - 'screen_function' => function() use ( $tab ) { |
|
118 | + 'screen_function' => function() use ($tab) { |
|
119 | 119 | $GLOBALS['getpaid_bp_current_tab'] = $tab; |
120 | 120 | $this->display_current_tab(); |
121 | 121 | }, |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | } |
127 | 127 | |
128 | - parent::setup_nav( $main_nav, $sub_nav ); |
|
128 | + parent::setup_nav($main_nav, $sub_nav); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -139,29 +139,29 @@ discard block |
||
139 | 139 | * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a |
140 | 140 | * description. |
141 | 141 | */ |
142 | - public function setup_admin_bar( $wp_admin_nav = array() ) { |
|
142 | + public function setup_admin_bar($wp_admin_nav = array()) { |
|
143 | 143 | |
144 | 144 | // Menus for logged in user. |
145 | - if ( is_user_logged_in() ) { |
|
145 | + if (is_user_logged_in()) { |
|
146 | 146 | |
147 | 147 | // Setup the logged in user variables. |
148 | - $payments_link = trailingslashit( bp_loggedin_user_domain() . 'getpaid/' ); |
|
148 | + $payments_link = trailingslashit(bp_loggedin_user_domain() . 'getpaid/'); |
|
149 | 149 | |
150 | 150 | // Add the "Payments" sub menu. |
151 | 151 | $wp_admin_nav[] = array( |
152 | 152 | 'parent' => buddypress()->my_account_menu_id, |
153 | 153 | 'id' => 'my-account-getpaid', |
154 | - 'title' => _x( 'Billing', 'BuddyPress my account payments sub nav', 'invoicing' ), |
|
154 | + 'title' => _x('Billing', 'BuddyPress my account payments sub nav', 'invoicing'), |
|
155 | 155 | 'href' => $payments_link . 'gp-edit-address' |
156 | 156 | ); |
157 | 157 | |
158 | - foreach ( getpaid_get_user_content_tabs() as $slug => $tab ) { |
|
158 | + foreach (getpaid_get_user_content_tabs() as $slug => $tab) { |
|
159 | 159 | |
160 | 160 | $wp_admin_nav[] = array( |
161 | 161 | 'parent' => 'my-account-getpaid', |
162 | 162 | 'id' => 'my-account-getpaid' . $slug, |
163 | - 'title' => $tab[ 'label'], |
|
164 | - 'href' => trailingslashit( $payments_link . $slug ), |
|
163 | + 'title' => $tab['label'], |
|
164 | + 'href' => trailingslashit($payments_link . $slug), |
|
165 | 165 | 'position' => 20 |
166 | 166 | ); |
167 | 167 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | } |
171 | 171 | |
172 | - parent::setup_admin_bar( $wp_admin_nav ); |
|
172 | + parent::setup_admin_bar($wp_admin_nav); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | public function get_current_tab() { |
181 | 181 | global $getpaid_bp_current_tab; |
182 | 182 | |
183 | - if ( empty( $getpaid_bp_current_tab ) ) { |
|
183 | + if (empty($getpaid_bp_current_tab)) { |
|
184 | 184 | return array( |
185 | - 'label' => __( 'Invoices', 'invoicing' ), |
|
185 | + 'label' => __('Invoices', 'invoicing'), |
|
186 | 186 | 'content' => '[wpinv_history]', |
187 | 187 | 'icon' => 'fas fa-file-invoice', |
188 | 188 | ); |
@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function display_current_tab() { |
200 | 200 | |
201 | - add_action( 'bp_template_content', array( $this, 'handle_display_current_tab' ) ); |
|
202 | - $template = apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ); |
|
201 | + add_action('bp_template_content', array($this, 'handle_display_current_tab')); |
|
202 | + $template = apply_filters('bp_core_template_plugin', 'members/single/plugins'); |
|
203 | 203 | |
204 | - bp_core_load_template( apply_filters( 'wpinv_bp_core_template_plugin', $template ) ); |
|
204 | + bp_core_load_template(apply_filters('wpinv_bp_core_template_plugin', $template)); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @since 2.1.5 |
211 | 211 | */ |
212 | 212 | public function handle_display_current_tab() { |
213 | - echo getpaid_prepare_user_content_tab( $this->get_current_tab() ); |
|
213 | + echo getpaid_prepare_user_content_tab($this->get_current_tab()); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @since 1.0.0 |
7 | 7 | */ |
8 | 8 | |
9 | -defined( 'ABSPATH' ) || exit; |
|
9 | +defined('ABSPATH') || exit; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Main Invoicing class. |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * @param string $prop The prop to set. |
57 | 57 | * @param mixed $value The value to retrieve. |
58 | 58 | */ |
59 | - public function set( $prop, $value ) { |
|
60 | - $this->data[ $prop ] = $value; |
|
59 | + public function set($prop, $value) { |
|
60 | + $this->data[$prop] = $value; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | * @param string $prop The prop to set. |
67 | 67 | * @return mixed The value. |
68 | 68 | */ |
69 | - public function get( $prop ) { |
|
69 | + public function get($prop) { |
|
70 | 70 | |
71 | - if ( isset( $this->data[ $prop ] ) ) { |
|
72 | - return $this->data[ $prop ]; |
|
71 | + if (isset($this->data[$prop])) { |
|
72 | + return $this->data[$prop]; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | return null; |
@@ -81,23 +81,23 @@ discard block |
||
81 | 81 | public function set_properties() { |
82 | 82 | |
83 | 83 | // Sessions. |
84 | - $this->set( 'session', new WPInv_Session_Handler() ); |
|
85 | - $GLOBALS['wpi_session'] = $this->get( 'session' ); // Backwards compatibility. |
|
84 | + $this->set('session', new WPInv_Session_Handler()); |
|
85 | + $GLOBALS['wpi_session'] = $this->get('session'); // Backwards compatibility. |
|
86 | 86 | $GLOBALS['wpinv_euvat'] = new WPInv_EUVat(); // Backwards compatibility. |
87 | 87 | |
88 | 88 | // Init other objects. |
89 | - $this->set( 'session', new WPInv_Session_Handler() ); |
|
90 | - $this->set( 'notes', new WPInv_Notes() ); |
|
91 | - $this->set( 'api', new WPInv_API() ); |
|
92 | - $this->set( 'post_types', new GetPaid_Post_Types() ); |
|
93 | - $this->set( 'template', new GetPaid_Template() ); |
|
94 | - $this->set( 'admin', new GetPaid_Admin() ); |
|
95 | - $this->set( 'subscriptions', new WPInv_Subscriptions() ); |
|
96 | - $this->set( 'invoice_emails', new GetPaid_Invoice_Notification_Emails() ); |
|
97 | - $this->set( 'subscription_emails', new GetPaid_Subscription_Notification_Emails() ); |
|
98 | - $this->set( 'daily_maintenace', new GetPaid_Daily_Maintenance() ); |
|
99 | - $this->set( 'payment_forms', new GetPaid_Payment_Forms() ); |
|
100 | - $this->set( 'maxmind', new GetPaid_MaxMind_Geolocation() ); |
|
89 | + $this->set('session', new WPInv_Session_Handler()); |
|
90 | + $this->set('notes', new WPInv_Notes()); |
|
91 | + $this->set('api', new WPInv_API()); |
|
92 | + $this->set('post_types', new GetPaid_Post_Types()); |
|
93 | + $this->set('template', new GetPaid_Template()); |
|
94 | + $this->set('admin', new GetPaid_Admin()); |
|
95 | + $this->set('subscriptions', new WPInv_Subscriptions()); |
|
96 | + $this->set('invoice_emails', new GetPaid_Invoice_Notification_Emails()); |
|
97 | + $this->set('subscription_emails', new GetPaid_Subscription_Notification_Emails()); |
|
98 | + $this->set('daily_maintenace', new GetPaid_Daily_Maintenance()); |
|
99 | + $this->set('payment_forms', new GetPaid_Payment_Forms()); |
|
100 | + $this->set('maxmind', new GetPaid_MaxMind_Geolocation()); |
|
101 | 101 | |
102 | 102 | } |
103 | 103 | |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | * Define plugin constants. |
106 | 106 | */ |
107 | 107 | public function define_constants() { |
108 | - define( 'WPINV_PLUGIN_DIR', plugin_dir_path( WPINV_PLUGIN_FILE ) ); |
|
109 | - define( 'WPINV_PLUGIN_URL', plugin_dir_url( WPINV_PLUGIN_FILE ) ); |
|
108 | + define('WPINV_PLUGIN_DIR', plugin_dir_path(WPINV_PLUGIN_FILE)); |
|
109 | + define('WPINV_PLUGIN_URL', plugin_dir_url(WPINV_PLUGIN_FILE)); |
|
110 | 110 | $this->version = WPINV_VERSION; |
111 | 111 | } |
112 | 112 | |
@@ -117,23 +117,23 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function init_hooks() { |
119 | 119 | /* Internationalize the text strings used. */ |
120 | - add_action( 'plugins_loaded', array( &$this, 'plugins_loaded' ) ); |
|
120 | + add_action('plugins_loaded', array(&$this, 'plugins_loaded')); |
|
121 | 121 | |
122 | 122 | // Init the plugin after WordPress inits. |
123 | - add_action( 'init', array( $this, 'init' ), 1 ); |
|
124 | - add_action( 'init', array( $this, 'maybe_process_ipn' ), 10 ); |
|
125 | - add_action( 'init', array( $this, 'wpinv_actions' ) ); |
|
126 | - add_action( 'init', array( $this, 'maybe_do_authenticated_action' ), 100 ); |
|
127 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 11 ); |
|
128 | - add_action( 'wp_footer', array( $this, 'wp_footer' ) ); |
|
129 | - add_action( 'wp_head', array( $this, 'wp_head' ) ); |
|
130 | - add_action( 'widgets_init', array( &$this, 'register_widgets' ) ); |
|
131 | - add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', array( $this, 'wpseo_exclude_from_sitemap_by_post_ids' ) ); |
|
132 | - add_filter( 'pre_get_posts', array( &$this, 'pre_get_posts' ) ); |
|
123 | + add_action('init', array($this, 'init'), 1); |
|
124 | + add_action('init', array($this, 'maybe_process_ipn'), 10); |
|
125 | + add_action('init', array($this, 'wpinv_actions')); |
|
126 | + add_action('init', array($this, 'maybe_do_authenticated_action'), 100); |
|
127 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'), 11); |
|
128 | + add_action('wp_footer', array($this, 'wp_footer')); |
|
129 | + add_action('wp_head', array($this, 'wp_head')); |
|
130 | + add_action('widgets_init', array(&$this, 'register_widgets')); |
|
131 | + add_filter('wpseo_exclude_from_sitemap_by_post_ids', array($this, 'wpseo_exclude_from_sitemap_by_post_ids')); |
|
132 | + add_filter('pre_get_posts', array(&$this, 'pre_get_posts')); |
|
133 | 133 | |
134 | 134 | // Fires after registering actions. |
135 | - do_action( 'wpinv_actions', $this ); |
|
136 | - do_action( 'getpaid_actions', $this ); |
|
135 | + do_action('wpinv_actions', $this); |
|
136 | + do_action('getpaid_actions', $this); |
|
137 | 137 | |
138 | 138 | } |
139 | 139 | |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | /* Internationalize the text strings used. */ |
142 | 142 | $this->load_textdomain(); |
143 | 143 | |
144 | - do_action( 'wpinv_loaded' ); |
|
144 | + do_action('wpinv_loaded'); |
|
145 | 145 | |
146 | 146 | // Fix oxygen page builder conflict |
147 | - if ( function_exists( 'ct_css_output' ) ) { |
|
147 | + if (function_exists('ct_css_output')) { |
|
148 | 148 | wpinv_oxygen_fix_conflict(); |
149 | 149 | } |
150 | 150 | } |
@@ -154,21 +154,21 @@ discard block |
||
154 | 154 | * |
155 | 155 | * @since 1.0 |
156 | 156 | */ |
157 | - public function load_textdomain( $locale = NULL ) { |
|
158 | - if ( empty( $locale ) ) { |
|
159 | - $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale(); |
|
157 | + public function load_textdomain($locale = NULL) { |
|
158 | + if (empty($locale)) { |
|
159 | + $locale = is_admin() && function_exists('get_user_locale') ? get_user_locale() : get_locale(); |
|
160 | 160 | } |
161 | 161 | |
162 | - $locale = apply_filters( 'plugin_locale', $locale, 'invoicing' ); |
|
162 | + $locale = apply_filters('plugin_locale', $locale, 'invoicing'); |
|
163 | 163 | |
164 | - unload_textdomain( 'invoicing' ); |
|
165 | - load_textdomain( 'invoicing', WP_LANG_DIR . '/invoicing/invoicing-' . $locale . '.mo' ); |
|
166 | - load_plugin_textdomain( 'invoicing', false, WPINV_PLUGIN_DIR . 'languages' ); |
|
164 | + unload_textdomain('invoicing'); |
|
165 | + load_textdomain('invoicing', WP_LANG_DIR . '/invoicing/invoicing-' . $locale . '.mo'); |
|
166 | + load_plugin_textdomain('invoicing', false, WPINV_PLUGIN_DIR . 'languages'); |
|
167 | 167 | |
168 | 168 | /** |
169 | 169 | * Define language constants. |
170 | 170 | */ |
171 | - require_once( WPINV_PLUGIN_DIR . 'language.php' ); |
|
171 | + require_once(WPINV_PLUGIN_DIR . 'language.php'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -177,78 +177,78 @@ discard block |
||
177 | 177 | public function includes() { |
178 | 178 | |
179 | 179 | // Start with the settings. |
180 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/register-settings.php' ); |
|
180 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/register-settings.php'); |
|
181 | 181 | |
182 | 182 | // Packages/libraries. |
183 | - require_once( WPINV_PLUGIN_DIR . 'vendor/autoload.php' ); |
|
184 | - require_once( WPINV_PLUGIN_DIR . 'vendor/ayecode/wp-ayecode-ui/ayecode-ui-loader.php' ); |
|
183 | + require_once(WPINV_PLUGIN_DIR . 'vendor/autoload.php'); |
|
184 | + require_once(WPINV_PLUGIN_DIR . 'vendor/ayecode/wp-ayecode-ui/ayecode-ui-loader.php'); |
|
185 | 185 | |
186 | 186 | // Load functions. |
187 | - require_once( WPINV_PLUGIN_DIR . 'includes/deprecated-functions.php' ); |
|
188 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-email-functions.php' ); |
|
189 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-general-functions.php' ); |
|
190 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-helper-functions.php' ); |
|
191 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-tax-functions.php' ); |
|
192 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-template-functions.php' ); |
|
193 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-address-functions.php' ); |
|
194 | - require_once( WPINV_PLUGIN_DIR . 'includes/invoice-functions.php' ); |
|
195 | - require_once( WPINV_PLUGIN_DIR . 'includes/subscription-functions.php' ); |
|
196 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-item-functions.php' ); |
|
197 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-discount-functions.php' ); |
|
198 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-gateway-functions.php' ); |
|
199 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-payment-functions.php' ); |
|
200 | - require_once( WPINV_PLUGIN_DIR . 'includes/user-functions.php' ); |
|
201 | - require_once( WPINV_PLUGIN_DIR . 'includes/error-functions.php' ); |
|
187 | + require_once(WPINV_PLUGIN_DIR . 'includes/deprecated-functions.php'); |
|
188 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-email-functions.php'); |
|
189 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-general-functions.php'); |
|
190 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-helper-functions.php'); |
|
191 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-tax-functions.php'); |
|
192 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-template-functions.php'); |
|
193 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-address-functions.php'); |
|
194 | + require_once(WPINV_PLUGIN_DIR . 'includes/invoice-functions.php'); |
|
195 | + require_once(WPINV_PLUGIN_DIR . 'includes/subscription-functions.php'); |
|
196 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-item-functions.php'); |
|
197 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-discount-functions.php'); |
|
198 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-gateway-functions.php'); |
|
199 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-payment-functions.php'); |
|
200 | + require_once(WPINV_PLUGIN_DIR . 'includes/user-functions.php'); |
|
201 | + require_once(WPINV_PLUGIN_DIR . 'includes/error-functions.php'); |
|
202 | 202 | |
203 | 203 | // Register autoloader. |
204 | 204 | try { |
205 | - spl_autoload_register( array( $this, 'autoload' ), true ); |
|
206 | - } catch ( Exception $e ) { |
|
207 | - wpinv_error_log( $e->getMessage(), '', __FILE__, 149, true ); |
|
205 | + spl_autoload_register(array($this, 'autoload'), true); |
|
206 | + } catch (Exception $e) { |
|
207 | + wpinv_error_log($e->getMessage(), '', __FILE__, 149, true); |
|
208 | 208 | } |
209 | 209 | |
210 | - require_once( WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-session.php' ); |
|
211 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-session-handler.php' ); |
|
212 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-ajax.php' ); |
|
213 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-api.php' ); |
|
214 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-cache-helper.php' ); |
|
215 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-db.php' ); |
|
216 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/subscriptions.php' ); |
|
217 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-subscriptions-db.php' ); |
|
218 | - require_once( WPINV_PLUGIN_DIR . 'includes/wpinv-subscription.php' ); |
|
219 | - require_once( WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-privacy.php' ); |
|
220 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-privacy.php' ); |
|
221 | - require_once( WPINV_PLUGIN_DIR . 'includes/libraries/class-ayecode-addons.php' ); |
|
222 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-addons.php' ); |
|
223 | - require_once( WPINV_PLUGIN_DIR . 'widgets/checkout.php' ); |
|
224 | - require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-history.php' ); |
|
225 | - require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-receipt.php' ); |
|
226 | - require_once( WPINV_PLUGIN_DIR . 'widgets/invoice-messages.php' ); |
|
227 | - require_once( WPINV_PLUGIN_DIR . 'widgets/subscriptions.php' ); |
|
228 | - require_once( WPINV_PLUGIN_DIR . 'widgets/buy-item.php' ); |
|
229 | - require_once( WPINV_PLUGIN_DIR . 'widgets/getpaid.php' ); |
|
230 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/admin-pages.php' ); |
|
231 | - |
|
232 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
210 | + require_once(WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-session.php'); |
|
211 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-session-handler.php'); |
|
212 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-ajax.php'); |
|
213 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-api.php'); |
|
214 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-cache-helper.php'); |
|
215 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-db.php'); |
|
216 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/subscriptions.php'); |
|
217 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-subscriptions-db.php'); |
|
218 | + require_once(WPINV_PLUGIN_DIR . 'includes/wpinv-subscription.php'); |
|
219 | + require_once(WPINV_PLUGIN_DIR . 'includes/abstracts/abstract-wpinv-privacy.php'); |
|
220 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-privacy.php'); |
|
221 | + require_once(WPINV_PLUGIN_DIR . 'includes/libraries/class-ayecode-addons.php'); |
|
222 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-addons.php'); |
|
223 | + require_once(WPINV_PLUGIN_DIR . 'widgets/checkout.php'); |
|
224 | + require_once(WPINV_PLUGIN_DIR . 'widgets/invoice-history.php'); |
|
225 | + require_once(WPINV_PLUGIN_DIR . 'widgets/invoice-receipt.php'); |
|
226 | + require_once(WPINV_PLUGIN_DIR . 'widgets/invoice-messages.php'); |
|
227 | + require_once(WPINV_PLUGIN_DIR . 'widgets/subscriptions.php'); |
|
228 | + require_once(WPINV_PLUGIN_DIR . 'widgets/buy-item.php'); |
|
229 | + require_once(WPINV_PLUGIN_DIR . 'widgets/getpaid.php'); |
|
230 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/admin-pages.php'); |
|
231 | + |
|
232 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
233 | 233 | GetPaid_Post_Types_Admin::init(); |
234 | 234 | |
235 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/wpinv-admin-functions.php' ); |
|
236 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-payment-form.php' ); |
|
237 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-notes.php' ); |
|
238 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-admin-menus.php' ); |
|
239 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-users.php' ); |
|
240 | - require_once( WPINV_PLUGIN_DIR . 'includes/admin/class-getpaid-admin-profile.php' ); |
|
235 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/wpinv-admin-functions.php'); |
|
236 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-payment-form.php'); |
|
237 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/meta-boxes/class-mb-invoice-notes.php'); |
|
238 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-admin-menus.php'); |
|
239 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/class-wpinv-users.php'); |
|
240 | + require_once(WPINV_PLUGIN_DIR . 'includes/admin/class-getpaid-admin-profile.php'); |
|
241 | 241 | // load the user class only on the users.php page |
242 | 242 | global $pagenow; |
243 | - if($pagenow=='users.php'){ |
|
243 | + if ($pagenow == 'users.php') { |
|
244 | 244 | new WPInv_Admin_Users(); |
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
248 | 248 | // Register cli commands |
249 | - if ( defined( 'WP_CLI' ) && WP_CLI ) { |
|
250 | - require_once( WPINV_PLUGIN_DIR . 'includes/class-wpinv-cli.php' ); |
|
251 | - WP_CLI::add_command( 'invoicing', 'WPInv_CLI' ); |
|
249 | + if (defined('WP_CLI') && WP_CLI) { |
|
250 | + require_once(WPINV_PLUGIN_DIR . 'includes/class-wpinv-cli.php'); |
|
251 | + WP_CLI::add_command('invoicing', 'WPInv_CLI'); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | } |
@@ -261,21 +261,21 @@ discard block |
||
261 | 261 | * @since 1.0.19 |
262 | 262 | * @return void |
263 | 263 | */ |
264 | - public function autoload( $class_name ) { |
|
264 | + public function autoload($class_name) { |
|
265 | 265 | |
266 | 266 | // Normalize the class name... |
267 | - $class_name = strtolower( $class_name ); |
|
267 | + $class_name = strtolower($class_name); |
|
268 | 268 | |
269 | 269 | // ... and make sure it is our class. |
270 | - if ( false === strpos( $class_name, 'getpaid_' ) && false === strpos( $class_name, 'wpinv_' ) ) { |
|
270 | + if (false === strpos($class_name, 'getpaid_') && false === strpos($class_name, 'wpinv_')) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // Next, prepare the file name from the class. |
275 | - $file_name = 'class-' . str_replace( '_', '-', $class_name ) . '.php'; |
|
275 | + $file_name = 'class-' . str_replace('_', '-', $class_name) . '.php'; |
|
276 | 276 | |
277 | 277 | // Base path of the classes. |
278 | - $plugin_path = untrailingslashit( WPINV_PLUGIN_DIR ); |
|
278 | + $plugin_path = untrailingslashit(WPINV_PLUGIN_DIR); |
|
279 | 279 | |
280 | 280 | // And an array of possible locations in order of importance. |
281 | 281 | $locations = array( |
@@ -290,10 +290,10 @@ discard block |
||
290 | 290 | "$plugin_path/includes/admin/meta-boxes", |
291 | 291 | ); |
292 | 292 | |
293 | - foreach ( apply_filters( 'getpaid_autoload_locations', $locations ) as $location ) { |
|
293 | + foreach (apply_filters('getpaid_autoload_locations', $locations) as $location) { |
|
294 | 294 | |
295 | - if ( file_exists( trailingslashit( $location ) . $file_name ) ) { |
|
296 | - include trailingslashit( $location ) . $file_name; |
|
295 | + if (file_exists(trailingslashit($location) . $file_name)) { |
|
296 | + include trailingslashit($location) . $file_name; |
|
297 | 297 | break; |
298 | 298 | } |
299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | public function init() { |
308 | 308 | |
309 | 309 | // Fires before getpaid inits. |
310 | - do_action( 'before_getpaid_init', $this ); |
|
310 | + do_action('before_getpaid_init', $this); |
|
311 | 311 | |
312 | 312 | // Maybe upgrade. |
313 | 313 | $this->maybe_upgrade_database(); |
@@ -324,12 +324,12 @@ discard block |
||
324 | 324 | ) |
325 | 325 | ); |
326 | 326 | |
327 | - foreach ( $gateways as $id => $class ) { |
|
328 | - $this->gateways[ $id ] = new $class(); |
|
327 | + foreach ($gateways as $id => $class) { |
|
328 | + $this->gateways[$id] = new $class(); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | // Fires after getpaid inits. |
332 | - do_action( 'getpaid_init', $this ); |
|
332 | + do_action('getpaid_init', $this); |
|
333 | 333 | |
334 | 334 | } |
335 | 335 | |
@@ -339,14 +339,14 @@ discard block |
||
339 | 339 | public function maybe_process_ipn() { |
340 | 340 | |
341 | 341 | // Ensure that this is an IPN request. |
342 | - if ( empty( $_GET['wpi-listener'] ) || 'IPN' !== $_GET['wpi-listener'] || empty( $_GET['wpi-gateway'] ) ) { |
|
342 | + if (empty($_GET['wpi-listener']) || 'IPN' !== $_GET['wpi-listener'] || empty($_GET['wpi-gateway'])) { |
|
343 | 343 | return; |
344 | 344 | } |
345 | 345 | |
346 | - $gateway = wpinv_clean( $_GET['wpi-gateway'] ); |
|
346 | + $gateway = wpinv_clean($_GET['wpi-gateway']); |
|
347 | 347 | |
348 | - do_action( 'wpinv_verify_payment_ipn', $gateway ); |
|
349 | - do_action( "wpinv_verify_{$gateway}_ipn" ); |
|
348 | + do_action('wpinv_verify_payment_ipn', $gateway); |
|
349 | + do_action("wpinv_verify_{$gateway}_ipn"); |
|
350 | 350 | exit; |
351 | 351 | |
352 | 352 | } |
@@ -354,27 +354,27 @@ discard block |
||
354 | 354 | public function enqueue_scripts() { |
355 | 355 | |
356 | 356 | // Fires before adding scripts. |
357 | - do_action( 'getpaid_enqueue_scripts' ); |
|
357 | + do_action('getpaid_enqueue_scripts'); |
|
358 | 358 | |
359 | 359 | $localize = array(); |
360 | - $localize['ajax_url'] = admin_url( 'admin-ajax.php' ); |
|
361 | - $localize['nonce'] = wp_create_nonce( 'wpinv-nonce' ); |
|
362 | - $localize['txtComplete'] = __( 'Continue', 'invoicing' ); |
|
360 | + $localize['ajax_url'] = admin_url('admin-ajax.php'); |
|
361 | + $localize['nonce'] = wp_create_nonce('wpinv-nonce'); |
|
362 | + $localize['txtComplete'] = __('Continue', 'invoicing'); |
|
363 | 363 | $localize['UseTaxes'] = wpinv_use_taxes(); |
364 | - $localize['formNonce'] = wp_create_nonce( 'getpaid_form_nonce' ); |
|
365 | - $localize['loading'] = __( 'Loading...', 'invoicing' ); |
|
366 | - $localize['connectionError'] = __( 'Could not establish a connection to the server.', 'invoicing' ); |
|
364 | + $localize['formNonce'] = wp_create_nonce('getpaid_form_nonce'); |
|
365 | + $localize['loading'] = __('Loading...', 'invoicing'); |
|
366 | + $localize['connectionError'] = __('Could not establish a connection to the server.', 'invoicing'); |
|
367 | 367 | |
368 | - $localize = apply_filters( 'wpinv_front_js_localize', $localize ); |
|
368 | + $localize = apply_filters('wpinv_front_js_localize', $localize); |
|
369 | 369 | |
370 | - $version = filemtime( WPINV_PLUGIN_DIR . 'assets/js/payment-forms.js' ); |
|
371 | - wp_enqueue_script( 'wpinv-front-script', WPINV_PLUGIN_URL . 'assets/js/payment-forms.js', array( 'jquery' ), $version, true ); |
|
372 | - wp_localize_script( 'wpinv-front-script', 'WPInv', $localize ); |
|
370 | + $version = filemtime(WPINV_PLUGIN_DIR . 'assets/js/payment-forms.js'); |
|
371 | + wp_enqueue_script('wpinv-front-script', WPINV_PLUGIN_URL . 'assets/js/payment-forms.js', array('jquery'), $version, true); |
|
372 | + wp_localize_script('wpinv-front-script', 'WPInv', $localize); |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | public function wpinv_actions() { |
376 | - if ( isset( $_REQUEST['wpi_action'] ) ) { |
|
377 | - do_action( 'wpinv_' . wpinv_sanitize_key( $_REQUEST['wpi_action'] ), $_REQUEST ); |
|
376 | + if (isset($_REQUEST['wpi_action'])) { |
|
377 | + do_action('wpinv_' . wpinv_sanitize_key($_REQUEST['wpi_action']), $_REQUEST); |
|
378 | 378 | } |
379 | 379 | } |
380 | 380 | |
@@ -386,24 +386,24 @@ discard block |
||
386 | 386 | */ |
387 | 387 | public function maybe_do_authenticated_action() { |
388 | 388 | |
389 | - if ( isset( $_REQUEST['getpaid-action'] ) && isset( $_REQUEST['getpaid-nonce'] ) && wp_verify_nonce( $_REQUEST['getpaid-nonce'], 'getpaid-nonce' ) ) { |
|
389 | + if (isset($_REQUEST['getpaid-action']) && isset($_REQUEST['getpaid-nonce']) && wp_verify_nonce($_REQUEST['getpaid-nonce'], 'getpaid-nonce')) { |
|
390 | 390 | |
391 | - $key = sanitize_key( $_REQUEST['getpaid-action'] ); |
|
392 | - $data = wp_unslash( $_REQUEST ); |
|
393 | - if ( is_user_logged_in() ) { |
|
394 | - do_action( "getpaid_authenticated_action_$key", $data ); |
|
391 | + $key = sanitize_key($_REQUEST['getpaid-action']); |
|
392 | + $data = wp_unslash($_REQUEST); |
|
393 | + if (is_user_logged_in()) { |
|
394 | + do_action("getpaid_authenticated_action_$key", $data); |
|
395 | 395 | } |
396 | 396 | |
397 | - do_action( "getpaid_unauthenticated_action_$key", $data ); |
|
397 | + do_action("getpaid_unauthenticated_action_$key", $data); |
|
398 | 398 | |
399 | 399 | } |
400 | 400 | |
401 | 401 | } |
402 | 402 | |
403 | - public function pre_get_posts( $wp_query ) { |
|
403 | + public function pre_get_posts($wp_query) { |
|
404 | 404 | |
405 | - if ( ! is_admin() && ! empty( $wp_query->query_vars['post_type'] ) && getpaid_is_invoice_post_type( $wp_query->query_vars['post_type'] ) && is_user_logged_in() && is_single() && $wp_query->is_main_query() ) { |
|
406 | - $wp_query->query_vars['post_status'] = array_keys( wpinv_get_invoice_statuses( false, false, $wp_query->query_vars['post_type'] ) ); |
|
405 | + if (!is_admin() && !empty($wp_query->query_vars['post_type']) && getpaid_is_invoice_post_type($wp_query->query_vars['post_type']) && is_user_logged_in() && is_single() && $wp_query->is_main_query()) { |
|
406 | + $wp_query->query_vars['post_status'] = array_keys(wpinv_get_invoice_statuses(false, false, $wp_query->query_vars['post_type'])); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | return $wp_query; |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | // Currently, UX Builder does not work particulaly well with SuperDuper. |
419 | 419 | // So we disable our widgets when editing a page with UX Builder. |
420 | - if ( function_exists( 'ux_builder_is_active' ) && ux_builder_is_active() ) { |
|
420 | + if (function_exists('ux_builder_is_active') && ux_builder_is_active()) { |
|
421 | 421 | return; |
422 | 422 | } |
423 | 423 | |
@@ -434,8 +434,8 @@ discard block |
||
434 | 434 | ) |
435 | 435 | ); |
436 | 436 | |
437 | - foreach ( $widgets as $widget ) { |
|
438 | - register_widget( $widget ); |
|
437 | + foreach ($widgets as $widget) { |
|
438 | + register_widget($widget); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | } |
@@ -447,29 +447,29 @@ discard block |
||
447 | 447 | */ |
448 | 448 | public function maybe_upgrade_database() { |
449 | 449 | |
450 | - $wpi_version = get_option( 'wpinv_version', 0 ); |
|
450 | + $wpi_version = get_option('wpinv_version', 0); |
|
451 | 451 | |
452 | - if ( $wpi_version == WPINV_VERSION ) { |
|
452 | + if ($wpi_version == WPINV_VERSION) { |
|
453 | 453 | return; |
454 | 454 | } |
455 | 455 | |
456 | 456 | $installer = new GetPaid_Installer(); |
457 | 457 | |
458 | - if ( empty( $wpi_version ) ) { |
|
459 | - return $installer->upgrade_db( 0 ); |
|
458 | + if (empty($wpi_version)) { |
|
459 | + return $installer->upgrade_db(0); |
|
460 | 460 | } |
461 | 461 | |
462 | - $upgrades = array( |
|
462 | + $upgrades = array( |
|
463 | 463 | '0.0.5' => '004', |
464 | 464 | '1.0.3' => '102', |
465 | 465 | '2.0.0' => '118', |
466 | 466 | '2.0.8' => '207', |
467 | 467 | ); |
468 | 468 | |
469 | - foreach ( $upgrades as $key => $method ) { |
|
469 | + foreach ($upgrades as $key => $method) { |
|
470 | 470 | |
471 | - if ( version_compare( $wpi_version, $key, '<' ) ) { |
|
472 | - return $installer->upgrade_db( $method ); |
|
471 | + if (version_compare($wpi_version, $key, '<')) { |
|
472 | + return $installer->upgrade_db($method); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | } |
@@ -483,11 +483,11 @@ discard block |
||
483 | 483 | */ |
484 | 484 | public function maybe_flush_permalinks() { |
485 | 485 | |
486 | - $flush = get_option( 'wpinv_flush_permalinks', 0 ); |
|
486 | + $flush = get_option('wpinv_flush_permalinks', 0); |
|
487 | 487 | |
488 | - if ( ! empty( $flush ) ) { |
|
488 | + if (!empty($flush)) { |
|
489 | 489 | flush_rewrite_rules(); |
490 | - delete_option( 'wpinv_flush_permalinks' ); |
|
490 | + delete_option('wpinv_flush_permalinks'); |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | } |
@@ -498,10 +498,10 @@ discard block |
||
498 | 498 | * @since 1.0.19 |
499 | 499 | * @param int[] $excluded_posts_ids |
500 | 500 | */ |
501 | - public function wpseo_exclude_from_sitemap_by_post_ids( $excluded_posts_ids ){ |
|
501 | + public function wpseo_exclude_from_sitemap_by_post_ids($excluded_posts_ids) { |
|
502 | 502 | |
503 | 503 | // Ensure that we have an array. |
504 | - if ( ! is_array( $excluded_posts_ids ) ) { |
|
504 | + if (!is_array($excluded_posts_ids)) { |
|
505 | 505 | $excluded_posts_ids = array(); |
506 | 506 | } |
507 | 507 | |
@@ -509,24 +509,24 @@ discard block |
||
509 | 509 | $our_pages = array(); |
510 | 510 | |
511 | 511 | // Checkout page. |
512 | - $our_pages[] = wpinv_get_option( 'checkout_page', false ); |
|
512 | + $our_pages[] = wpinv_get_option('checkout_page', false); |
|
513 | 513 | |
514 | 514 | // Success page. |
515 | - $our_pages[] = wpinv_get_option( 'success_page', false ); |
|
515 | + $our_pages[] = wpinv_get_option('success_page', false); |
|
516 | 516 | |
517 | 517 | // Failure page. |
518 | - $our_pages[] = wpinv_get_option( 'failure_page', false ); |
|
518 | + $our_pages[] = wpinv_get_option('failure_page', false); |
|
519 | 519 | |
520 | 520 | // History page. |
521 | - $our_pages[] = wpinv_get_option( 'invoice_history_page', false ); |
|
521 | + $our_pages[] = wpinv_get_option('invoice_history_page', false); |
|
522 | 522 | |
523 | 523 | // Subscriptions page. |
524 | - $our_pages[] = wpinv_get_option( 'invoice_subscription_page', false ); |
|
524 | + $our_pages[] = wpinv_get_option('invoice_subscription_page', false); |
|
525 | 525 | |
526 | - $our_pages = array_map( 'intval', array_filter( $our_pages ) ); |
|
526 | + $our_pages = array_map('intval', array_filter($our_pages)); |
|
527 | 527 | |
528 | 528 | $excluded_posts_ids = $excluded_posts_ids + $our_pages; |
529 | - return array_unique( $excluded_posts_ids ); |
|
529 | + return array_unique($excluded_posts_ids); |
|
530 | 530 | |
531 | 531 | } |
532 | 532 | |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | * @since 2.0.0 |
537 | 537 | */ |
538 | 538 | public function wp_footer() { |
539 | - wpinv_get_template( 'frontend-footer.php' ); |
|
539 | + wpinv_get_template('frontend-footer.php'); |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | /** |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | * @since 2.0.0 |
546 | 546 | */ |
547 | 547 | public function wp_head() { |
548 | - wpinv_get_template( 'frontend-head.php' ); |
|
548 | + wpinv_get_template('frontend-head.php'); |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | } |
@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | * Displays a list of all subscriptions rules |
4 | 4 | */ |
5 | 5 | |
6 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
6 | +if (!defined('ABSPATH')) exit; |
|
7 | 7 | |
8 | -if ( ! class_exists( 'WP_List_Table' ) ) { |
|
8 | +if (!class_exists('WP_List_Table')) { |
|
9 | 9 | include_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; |
10 | 10 | } |
11 | 11 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $this->prepare_query(); |
80 | 80 | |
81 | - $this->base_url = remove_query_arg( 'status' ); |
|
81 | + $this->base_url = remove_query_arg('status'); |
|
82 | 82 | |
83 | 83 | } |
84 | 84 | |
@@ -91,21 +91,21 @@ discard block |
||
91 | 91 | $query = array( |
92 | 92 | 'number' => $this->per_page, |
93 | 93 | 'paged' => $this->get_paged(), |
94 | - 'status' => ( isset( $_GET['status'] ) && array_key_exists( $_GET['status'], getpaid_get_subscription_statuses() ) ) ? $_GET['status'] : 'all', |
|
95 | - 'orderby' => ( isset( $_GET['orderby'] ) ) ? $_GET['orderby'] : 'id', |
|
96 | - 'order' => ( isset( $_GET['order'] ) ) ? $_GET['order'] : 'DESC', |
|
94 | + 'status' => (isset($_GET['status']) && array_key_exists($_GET['status'], getpaid_get_subscription_statuses())) ? $_GET['status'] : 'all', |
|
95 | + 'orderby' => (isset($_GET['orderby'])) ? $_GET['orderby'] : 'id', |
|
96 | + 'order' => (isset($_GET['order'])) ? $_GET['order'] : 'DESC', |
|
97 | 97 | ); |
98 | 98 | |
99 | 99 | // Prepare class properties. |
100 | - $this->query = new GetPaid_Subscriptions_Query( $query ); |
|
100 | + $this->query = new GetPaid_Subscriptions_Query($query); |
|
101 | 101 | $this->total_count = $this->query->get_total(); |
102 | 102 | $this->current_total_count = $this->query->get_total(); |
103 | 103 | $this->items = $this->query->get_results(); |
104 | - $this->status_counts = getpaid_get_subscription_status_counts( $query ); |
|
104 | + $this->status_counts = getpaid_get_subscription_status_counts($query); |
|
105 | 105 | |
106 | - if ( 'all' != $query['status'] ) { |
|
107 | - unset( $query['status'] ); |
|
108 | - $this->total_count = getpaid_get_subscriptions( $query, 'count' ); |
|
106 | + if ('all' != $query['status']) { |
|
107 | + unset($query['status']); |
|
108 | + $this->total_count = getpaid_get_subscriptions($query, 'count'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | } |
@@ -122,26 +122,26 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function get_views() { |
124 | 124 | |
125 | - $current = isset( $_GET['status'] ) ? $_GET['status'] : 'all'; |
|
125 | + $current = isset($_GET['status']) ? $_GET['status'] : 'all'; |
|
126 | 126 | $views = array( |
127 | 127 | |
128 | 128 | 'all' => sprintf( |
129 | 129 | '<a href="%s" %s>%s <span class="count">(%d)</span></a>', |
130 | - esc_url( add_query_arg( 'status', false, $this->base_url ) ), |
|
130 | + esc_url(add_query_arg('status', false, $this->base_url)), |
|
131 | 131 | $current === 'all' ? ' class="current"' : '', |
132 | - __('All','invoicing' ), |
|
132 | + __('All', 'invoicing'), |
|
133 | 133 | $this->total_count |
134 | 134 | ) |
135 | 135 | |
136 | 136 | ); |
137 | 137 | |
138 | - foreach ( array_filter( $this->status_counts ) as $status => $count ) { |
|
138 | + foreach (array_filter($this->status_counts) as $status => $count) { |
|
139 | 139 | |
140 | - $views[ $status ] = sprintf( |
|
140 | + $views[$status] = sprintf( |
|
141 | 141 | '<a href="%s" %s>%s <span class="count">(%d)</span></a>', |
142 | - esc_url( add_query_arg( 'status', urlencode( $status ), $this->base_url ) ), |
|
142 | + esc_url(add_query_arg('status', urlencode($status), $this->base_url)), |
|
143 | 143 | $current === $status ? ' class="current"' : '', |
144 | - sanitize_text_field( getpaid_get_subscription_status_label( $status ) ), |
|
144 | + sanitize_text_field(getpaid_get_subscription_status_label($status)), |
|
145 | 145 | $count |
146 | 146 | ); |
147 | 147 | |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | * @since 1.0.0 |
159 | 159 | * @return string |
160 | 160 | */ |
161 | - public function column_default( $item, $column_name ) { |
|
162 | - return apply_filters( "getpaid_subscriptions_table_column_$column_name", $item->$column_name ); |
|
161 | + public function column_default($item, $column_name) { |
|
162 | + return apply_filters("getpaid_subscriptions_table_column_$column_name", $item->$column_name); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | * @param WPInv_Subscription $item |
169 | 169 | * @return string |
170 | 170 | */ |
171 | - public function column_cb( $item ) { |
|
172 | - return sprintf( '<input type="checkbox" name="id[]" value="%s" />', esc_html( $item->get_id() ) ); |
|
171 | + public function column_cb($item) { |
|
172 | + return sprintf('<input type="checkbox" name="id[]" value="%s" />', esc_html($item->get_id())); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | /** |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @since 1.0.0 |
180 | 180 | * @return string |
181 | 181 | */ |
182 | - public function column_status( $item ) { |
|
182 | + public function column_status($item) { |
|
183 | 183 | return $item->get_status_label_html(); |
184 | 184 | } |
185 | 185 | |
@@ -190,44 +190,44 @@ discard block |
||
190 | 190 | * @since 1.0.0 |
191 | 191 | * @return string |
192 | 192 | */ |
193 | - public function column_subscription( $item ) { |
|
193 | + public function column_subscription($item) { |
|
194 | 194 | |
195 | - $username = __( '(Missing User)', 'invoicing' ); |
|
195 | + $username = __('(Missing User)', 'invoicing'); |
|
196 | 196 | |
197 | - $user = get_userdata( $item->get_customer_id() ); |
|
198 | - if ( $user ) { |
|
197 | + $user = get_userdata($item->get_customer_id()); |
|
198 | + if ($user) { |
|
199 | 199 | |
200 | 200 | $username = sprintf( |
201 | 201 | '<a href="user-edit.php?user_id=%s">%s</a>', |
202 | - absint( $user->ID ), |
|
203 | - ! empty( $user->display_name ) ? sanitize_text_field( $user->display_name ) : sanitize_email( $user->user_email ) |
|
202 | + absint($user->ID), |
|
203 | + !empty($user->display_name) ? sanitize_text_field($user->display_name) : sanitize_email($user->user_email) |
|
204 | 204 | ); |
205 | 205 | |
206 | 206 | } |
207 | 207 | |
208 | 208 | // translators: $1: is opening link, $2: is subscription id number, $3: is closing link tag, $4: is user's name |
209 | 209 | $column_content = sprintf( |
210 | - _x( '%1$s#%2$s%3$s for %4$s', 'Subscription title on admin table. (e.g.: #211 for John Doe)', 'invoicing' ), |
|
211 | - '<a href="' . esc_url( admin_url( 'admin.php?page=wpinv-subscriptions&id=' . absint( $item->get_id() ) ) ) . '">', |
|
212 | - '<strong>' . esc_attr( $item->get_id() ) . '</strong>', '</a>', |
|
210 | + _x('%1$s#%2$s%3$s for %4$s', 'Subscription title on admin table. (e.g.: #211 for John Doe)', 'invoicing'), |
|
211 | + '<a href="' . esc_url(admin_url('admin.php?page=wpinv-subscriptions&id=' . absint($item->get_id()))) . '">', |
|
212 | + '<strong>' . esc_attr($item->get_id()) . '</strong>', '</a>', |
|
213 | 213 | $username |
214 | 214 | ); |
215 | 215 | |
216 | 216 | $row_actions = array(); |
217 | 217 | |
218 | 218 | // View subscription. |
219 | - $view_url = esc_url( add_query_arg( 'id', $item->get_id(), admin_url( 'admin.php?page=wpinv-subscriptions' ) )); |
|
220 | - $row_actions['view'] = '<a href="' . $view_url . '">' . __( 'View Subscription', 'invoicing' ) . '</a>'; |
|
219 | + $view_url = esc_url(add_query_arg('id', $item->get_id(), admin_url('admin.php?page=wpinv-subscriptions'))); |
|
220 | + $row_actions['view'] = '<a href="' . $view_url . '">' . __('View Subscription', 'invoicing') . '</a>'; |
|
221 | 221 | |
222 | 222 | // View invoice. |
223 | - $invoice = get_post( $item->get_parent_invoice_id() ); |
|
223 | + $invoice = get_post($item->get_parent_invoice_id()); |
|
224 | 224 | |
225 | - if ( ! empty( $invoice ) ) { |
|
226 | - $invoice_url = get_edit_post_link( $invoice ); |
|
227 | - $row_actions['invoice'] = '<a href="' . $invoice_url . '">' . __( 'View Invoice', 'invoicing' ) . '</a>'; |
|
225 | + if (!empty($invoice)) { |
|
226 | + $invoice_url = get_edit_post_link($invoice); |
|
227 | + $row_actions['invoice'] = '<a href="' . $invoice_url . '">' . __('View Invoice', 'invoicing') . '</a>'; |
|
228 | 228 | } |
229 | 229 | |
230 | - $delete_url = esc_url( |
|
230 | + $delete_url = esc_url( |
|
231 | 231 | wp_nonce_url( |
232 | 232 | add_query_arg( |
233 | 233 | array( |
@@ -239,11 +239,11 @@ discard block |
||
239 | 239 | 'getpaid-nonce' |
240 | 240 | ) |
241 | 241 | ); |
242 | - $row_actions['delete'] = '<a class="text-danger" href="' . $delete_url . '">' . __( 'Delete Subscription', 'invoicing' ) . '</a>'; |
|
242 | + $row_actions['delete'] = '<a class="text-danger" href="' . $delete_url . '">' . __('Delete Subscription', 'invoicing') . '</a>'; |
|
243 | 243 | |
244 | - $row_actions = $this->row_actions( apply_filters( 'getpaid_subscription_table_row_actions', $row_actions, $item ) ); |
|
244 | + $row_actions = $this->row_actions(apply_filters('getpaid_subscription_table_row_actions', $row_actions, $item)); |
|
245 | 245 | |
246 | - return "<strong>$column_content</strong>" . $this->column_amount( $item ) . $row_actions; |
|
246 | + return "<strong>$column_content</strong>" . $this->column_amount($item) . $row_actions; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
@@ -253,8 +253,8 @@ discard block |
||
253 | 253 | * @since 1.0.0 |
254 | 254 | * @return string |
255 | 255 | */ |
256 | - public function column_renewal_date( $item ) { |
|
257 | - return getpaid_format_date_value( $item->get_expiration() ); |
|
256 | + public function column_renewal_date($item) { |
|
257 | + return getpaid_format_date_value($item->get_expiration()); |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | * @since 1.0.0 |
265 | 265 | * @return string |
266 | 266 | */ |
267 | - public function column_start_date( $item ) { |
|
268 | - return getpaid_format_date_value( $item->get_date_created() ); |
|
267 | + public function column_start_date($item) { |
|
268 | + return getpaid_format_date_value($item->get_date_created()); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | * @since 1.0.19 |
276 | 276 | * @return string |
277 | 277 | */ |
278 | - public function column_amount( $item ) { |
|
279 | - $amount = getpaid_get_formatted_subscription_amount( $item ); |
|
278 | + public function column_amount($item) { |
|
279 | + $amount = getpaid_get_formatted_subscription_amount($item); |
|
280 | 280 | return "<span class='text-muted form-text mt-2 mb-2'>$amount</span>"; |
281 | 281 | } |
282 | 282 | |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | * @since 1.0.0 |
288 | 288 | * @return string |
289 | 289 | */ |
290 | - public function column_renewals( $item ) { |
|
290 | + public function column_renewals($item) { |
|
291 | 291 | $max_bills = $item->get_bill_times(); |
292 | - return $item->get_times_billed() . ' / ' . ( empty( $max_bills ) ? "∞" : $max_bills ); |
|
292 | + return $item->get_times_billed() . ' / ' . (empty($max_bills) ? "∞" : $max_bills); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -299,16 +299,16 @@ discard block |
||
299 | 299 | * @since 1.0.0 |
300 | 300 | * @return string |
301 | 301 | */ |
302 | - public function column_item( $item ) { |
|
303 | - $_item = get_post( $item->get_product_id() ); |
|
302 | + public function column_item($item) { |
|
303 | + $_item = get_post($item->get_product_id()); |
|
304 | 304 | |
305 | - if ( ! empty( $_item ) ) { |
|
306 | - $link = get_edit_post_link( $_item ); |
|
307 | - $link = esc_url( $link ); |
|
308 | - $name = esc_html( get_the_title( $_item ) ); |
|
305 | + if (!empty($_item)) { |
|
306 | + $link = get_edit_post_link($_item); |
|
307 | + $link = esc_url($link); |
|
308 | + $name = esc_html(get_the_title($_item)); |
|
309 | 309 | return "<a href='$link'>$name</a>"; |
310 | 310 | } else { |
311 | - return sprintf( __( 'Item #%s', 'invoicing' ), $item->get_product_id() ); |
|
311 | + return sprintf(__('Item #%s', 'invoicing'), $item->get_product_id()); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | } |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @return int |
320 | 320 | */ |
321 | 321 | public function get_paged() { |
322 | - return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1; |
|
322 | + return isset($_GET['paged']) ? absint($_GET['paged']) : 1; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -332,13 +332,13 @@ discard block |
||
332 | 332 | $hidden = array(); |
333 | 333 | $sortable = $this->get_sortable_columns(); |
334 | 334 | |
335 | - $this->_column_headers = array( $columns, $hidden, $sortable ); |
|
335 | + $this->_column_headers = array($columns, $hidden, $sortable); |
|
336 | 336 | |
337 | 337 | $this->set_pagination_args( |
338 | 338 | array( |
339 | 339 | 'total_items' => $this->current_total_count, |
340 | 340 | 'per_page' => $this->per_page, |
341 | - 'total_pages' => ceil( $this->current_total_count / $this->per_page ) |
|
341 | + 'total_pages' => ceil($this->current_total_count / $this->per_page) |
|
342 | 342 | ) |
343 | 343 | ); |
344 | 344 | } |
@@ -348,18 +348,18 @@ discard block |
||
348 | 348 | * |
349 | 349 | * @return array |
350 | 350 | */ |
351 | - public function get_columns(){ |
|
351 | + public function get_columns() { |
|
352 | 352 | $columns = array( |
353 | 353 | 'cb' => '<input type="checkbox" />', |
354 | - 'subscription' => __( 'Subscription', 'invoicing' ), |
|
355 | - 'start_date' => __( 'Start Date', 'invoicing' ), |
|
356 | - 'renewal_date' => __( 'Next Payment', 'invoicing' ), |
|
357 | - 'renewals' => __( 'Payments', 'invoicing' ), |
|
358 | - 'item' => __( 'Item', 'invoicing' ), |
|
359 | - 'status' => __( 'Status', 'invoicing' ), |
|
354 | + 'subscription' => __('Subscription', 'invoicing'), |
|
355 | + 'start_date' => __('Start Date', 'invoicing'), |
|
356 | + 'renewal_date' => __('Next Payment', 'invoicing'), |
|
357 | + 'renewals' => __('Payments', 'invoicing'), |
|
358 | + 'item' => __('Item', 'invoicing'), |
|
359 | + 'status' => __('Status', 'invoicing'), |
|
360 | 360 | ); |
361 | 361 | |
362 | - return apply_filters( 'manage_getpaid_subscriptions_table_columns', $columns ); |
|
362 | + return apply_filters('manage_getpaid_subscriptions_table_columns', $columns); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | /** |
@@ -369,15 +369,15 @@ discard block |
||
369 | 369 | */ |
370 | 370 | public function get_sortable_columns() { |
371 | 371 | $sortable = array( |
372 | - 'subscription' => array( 'id', true ), |
|
373 | - 'start_date' => array( 'created', true ), |
|
374 | - 'renewal_date' => array( 'expiration', true ), |
|
375 | - 'renewals' => array( 'bill_times', true ), |
|
376 | - 'item' => array( 'product_id', true ), |
|
377 | - 'status' => array( 'status', true ), |
|
372 | + 'subscription' => array('id', true), |
|
373 | + 'start_date' => array('created', true), |
|
374 | + 'renewal_date' => array('expiration', true), |
|
375 | + 'renewals' => array('bill_times', true), |
|
376 | + 'item' => array('product_id', true), |
|
377 | + 'status' => array('status', true), |
|
378 | 378 | ); |
379 | 379 | |
380 | - return apply_filters( 'manage_getpaid_subscriptions_sortable_table_columns', $sortable ); |
|
380 | + return apply_filters('manage_getpaid_subscriptions_sortable_table_columns', $sortable); |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | /** |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | * @return bool |
387 | 387 | */ |
388 | 388 | public function has_items() { |
389 | - return ! empty( $this->current_total_count ); |
|
389 | + return !empty($this->current_total_count); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | /** |
@@ -7,15 +7,15 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // MUST have WordPress. |
10 | -if ( !defined( 'WPINC' ) ) { |
|
11 | - exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) ); |
|
10 | +if (!defined('WPINC')) { |
|
11 | + exit('Do NOT access this file directly: ' . basename(__FILE__)); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | |
15 | 15 | function wpinv_get_default_country() { |
16 | - $country = wpinv_get_option( 'default_country', 'UK' ); |
|
16 | + $country = wpinv_get_option('default_country', 'UK'); |
|
17 | 17 | |
18 | - return apply_filters( 'wpinv_default_country', $country ); |
|
18 | + return apply_filters('wpinv_default_country', $country); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return string |
25 | 25 | */ |
26 | -function getpaid_get_ip_country( $ip_address = '' ) { |
|
27 | - $country = GetPaid_Geolocation::geolocate_ip( $ip_address, true ); |
|
26 | +function getpaid_get_ip_country($ip_address = '') { |
|
27 | + $country = GetPaid_Geolocation::geolocate_ip($ip_address, true); |
|
28 | 28 | return $country['country']; |
29 | 29 | } |
30 | 30 | |
@@ -34,59 +34,59 @@ discard block |
||
34 | 34 | * @param string $country The country code to sanitize |
35 | 35 | * @return array |
36 | 36 | */ |
37 | -function wpinv_sanitize_country( $country ) { |
|
37 | +function wpinv_sanitize_country($country) { |
|
38 | 38 | |
39 | 39 | // Enure the country is specified |
40 | - if ( empty( $country ) ) { |
|
40 | + if (empty($country)) { |
|
41 | 41 | $country = wpinv_get_default_country(); |
42 | 42 | } |
43 | - return trim( wpinv_utf8_strtoupper( $country ) ); |
|
43 | + return trim(wpinv_utf8_strtoupper($country)); |
|
44 | 44 | |
45 | 45 | } |
46 | 46 | |
47 | -function wpinv_is_base_country( $country ) { |
|
47 | +function wpinv_is_base_country($country) { |
|
48 | 48 | $base_country = wpinv_get_default_country(); |
49 | 49 | |
50 | - if ( $base_country === 'UK' ) { |
|
50 | + if ($base_country === 'UK') { |
|
51 | 51 | $base_country = 'GB'; |
52 | 52 | } |
53 | - if ( $country == 'UK' ) { |
|
53 | + if ($country == 'UK') { |
|
54 | 54 | $country = 'GB'; |
55 | 55 | } |
56 | 56 | |
57 | - return ( $country && $country === $base_country ) ? true : false; |
|
57 | + return ($country && $country === $base_country) ? true : false; |
|
58 | 58 | } |
59 | 59 | |
60 | -function wpinv_country_name( $country_code = '' ) { |
|
60 | +function wpinv_country_name($country_code = '') { |
|
61 | 61 | $countries = wpinv_get_country_list(); |
62 | 62 | $country_code = $country_code == 'UK' ? 'GB' : $country_code; |
63 | - $country = isset( $countries[$country_code] ) ? $countries[$country_code] : $country_code; |
|
63 | + $country = isset($countries[$country_code]) ? $countries[$country_code] : $country_code; |
|
64 | 64 | |
65 | - return apply_filters( 'wpinv_country_name', $country, $country_code ); |
|
65 | + return apply_filters('wpinv_country_name', $country, $country_code); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | function wpinv_get_default_state() { |
69 | - $state = wpinv_get_option( 'default_state', '' ); |
|
69 | + $state = wpinv_get_option('default_state', ''); |
|
70 | 70 | |
71 | - return apply_filters( 'wpinv_default_state', $state ); |
|
71 | + return apply_filters('wpinv_default_state', $state); |
|
72 | 72 | } |
73 | 73 | |
74 | -function wpinv_state_name( $state_code = '', $country_code = '' ) { |
|
74 | +function wpinv_state_name($state_code = '', $country_code = '') { |
|
75 | 75 | $state = $state_code; |
76 | 76 | |
77 | - if ( !empty( $country_code ) ) { |
|
78 | - $states = wpinv_get_country_states( $country_code ); |
|
77 | + if (!empty($country_code)) { |
|
78 | + $states = wpinv_get_country_states($country_code); |
|
79 | 79 | |
80 | - $state = !empty( $states ) && isset( $states[$state_code] ) ? $states[$state_code] : $state; |
|
80 | + $state = !empty($states) && isset($states[$state_code]) ? $states[$state_code] : $state; |
|
81 | 81 | } |
82 | 82 | |
83 | - return apply_filters( 'wpinv_state_name', $state, $state_code, $country_code ); |
|
83 | + return apply_filters('wpinv_state_name', $state, $state_code, $country_code); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | function wpinv_store_address() { |
87 | - $address = wpinv_get_option( 'store_address', '' ); |
|
87 | + $address = wpinv_get_option('store_address', ''); |
|
88 | 88 | |
89 | - return apply_filters( 'wpinv_store_address', $address ); |
|
89 | + return apply_filters('wpinv_store_address', $address); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -94,24 +94,24 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @param WPInv_Invoice $invoice |
96 | 96 | */ |
97 | -function getpaid_maybe_add_default_address( &$invoice ) { |
|
97 | +function getpaid_maybe_add_default_address(&$invoice) { |
|
98 | 98 | |
99 | 99 | $user_id = $invoice->get_user_id(); |
100 | 100 | |
101 | 101 | // Abort if the invoice belongs to no one. |
102 | - if ( empty( $user_id ) ) { |
|
102 | + if (empty($user_id)) { |
|
103 | 103 | return; |
104 | 104 | } |
105 | 105 | |
106 | 106 | // Fill in defaults whenever necessary. |
107 | - foreach ( wpinv_get_user_address( $user_id ) as $key => $value ) { |
|
107 | + foreach (wpinv_get_user_address($user_id) as $key => $value) { |
|
108 | 108 | |
109 | - if ( is_callable( $invoice, "get_$key" ) ) { |
|
110 | - $current = call_user_func( array( $invoice, "get_$key" ) ); |
|
109 | + if (is_callable($invoice, "get_$key")) { |
|
110 | + $current = call_user_func(array($invoice, "get_$key")); |
|
111 | 111 | |
112 | - if ( empty( $current ) ) { |
|
112 | + if (empty($current)) { |
|
113 | 113 | $method = "set_$key"; |
114 | - $invoice->$method( $value ); |
|
114 | + $invoice->$method($value); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | } |
@@ -130,21 +130,21 @@ discard block |
||
130 | 130 | $address_fields = apply_filters( |
131 | 131 | 'getpaid_user_address_fields', |
132 | 132 | array( |
133 | - 'first_name' => __( 'First Name', 'invoicing' ), |
|
134 | - 'last_name' => __( 'Last Name', 'invoicing' ), |
|
135 | - 'country' => __( 'Country', 'invoicing' ), |
|
136 | - 'state' => __( 'State', 'invoicing' ), |
|
137 | - 'city' => __( 'City', 'invoicing' ), |
|
138 | - 'zip' => __( 'Zip/Postal Code', 'invoicing' ), |
|
139 | - 'address' => __( 'Address', 'invoicing' ), |
|
140 | - 'phone' => __( 'Phone Number', 'invoicing' ), |
|
141 | - 'company' => __( 'Company', 'invoicing' ), |
|
142 | - 'vat_number' => __( 'VAT Number', 'invoicing' ), |
|
133 | + 'first_name' => __('First Name', 'invoicing'), |
|
134 | + 'last_name' => __('Last Name', 'invoicing'), |
|
135 | + 'country' => __('Country', 'invoicing'), |
|
136 | + 'state' => __('State', 'invoicing'), |
|
137 | + 'city' => __('City', 'invoicing'), |
|
138 | + 'zip' => __('Zip/Postal Code', 'invoicing'), |
|
139 | + 'address' => __('Address', 'invoicing'), |
|
140 | + 'phone' => __('Phone Number', 'invoicing'), |
|
141 | + 'company' => __('Company', 'invoicing'), |
|
142 | + 'vat_number' => __('VAT Number', 'invoicing'), |
|
143 | 143 | ) |
144 | 144 | ); |
145 | 145 | |
146 | - if ( ! wpinv_use_taxes() && isset( $address_fields['vat_number'] ) ) { |
|
147 | - unset( $address_fields['vat_number'] ); |
|
146 | + if (!wpinv_use_taxes() && isset($address_fields['vat_number'])) { |
|
147 | + unset($address_fields['vat_number']); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | return $address_fields; |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @return bool |
157 | 157 | */ |
158 | -function getpaid_is_address_field_whitelisted( $key ) { |
|
159 | - return array_key_exists( $key, getpaid_user_address_fields() ); |
|
158 | +function getpaid_is_address_field_whitelisted($key) { |
|
159 | + return array_key_exists($key, getpaid_user_address_fields()); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -166,24 +166,24 @@ discard block |
||
166 | 166 | * |
167 | 167 | * @param WPInv_Invoice $invoice |
168 | 168 | */ |
169 | -function getpaid_save_invoice_user_address( $invoice ) { |
|
169 | +function getpaid_save_invoice_user_address($invoice) { |
|
170 | 170 | |
171 | 171 | // Retrieve the invoice. |
172 | - $invoice = wpinv_get_invoice( $invoice ); |
|
172 | + $invoice = wpinv_get_invoice($invoice); |
|
173 | 173 | |
174 | 174 | // Abort if it does not exist. |
175 | - if ( empty( $invoice ) ) { |
|
175 | + if (empty($invoice)) { |
|
176 | 176 | return; |
177 | 177 | } |
178 | 178 | |
179 | - foreach ( array_keys( getpaid_user_address_fields() ) as $field ) { |
|
179 | + foreach (array_keys(getpaid_user_address_fields()) as $field) { |
|
180 | 180 | |
181 | - if ( is_callable( array( $invoice, "get_$field" ) ) ) { |
|
182 | - $value = call_user_func( array( $invoice, "get_$field" ) ); |
|
181 | + if (is_callable(array($invoice, "get_$field"))) { |
|
182 | + $value = call_user_func(array($invoice, "get_$field")); |
|
183 | 183 | |
184 | 184 | // Only save if it is not empty. |
185 | - if ( ! empty( $value ) ) { |
|
186 | - update_user_meta( $invoice->get_user_id(), '_wpinv_' . $field, $value ); |
|
185 | + if (!empty($value)) { |
|
186 | + update_user_meta($invoice->get_user_id(), '_wpinv_' . $field, $value); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | } |
@@ -194,24 +194,24 @@ discard block |
||
194 | 194 | $last_name = $invoice->get_last_name(); |
195 | 195 | $update = array(); |
196 | 196 | |
197 | - if ( ! empty( $first_name ) ) { |
|
197 | + if (!empty($first_name)) { |
|
198 | 198 | $update['first_name'] = $first_name; |
199 | 199 | } |
200 | 200 | |
201 | - if ( ! empty( $last_name ) ) { |
|
201 | + if (!empty($last_name)) { |
|
202 | 202 | $update['last_name'] = $last_name; |
203 | 203 | } |
204 | 204 | |
205 | - if ( 2 == count( $update ) ) { |
|
206 | - $update['display_name'] = $first_name . ' ' .$last_name; |
|
205 | + if (2 == count($update)) { |
|
206 | + $update['display_name'] = $first_name . ' ' . $last_name; |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | $update['ID'] = $invoice->get_user_id(); |
210 | - wp_update_user( $update ); |
|
210 | + wp_update_user($update); |
|
211 | 211 | |
212 | 212 | } |
213 | -add_action( 'getpaid_new_invoice', 'getpaid_save_invoice_user_address' ); |
|
214 | -add_action( 'getpaid_update_invoice', 'getpaid_save_invoice_user_address' ); |
|
213 | +add_action('getpaid_new_invoice', 'getpaid_save_invoice_user_address'); |
|
214 | +add_action('getpaid_update_invoice', 'getpaid_save_invoice_user_address'); |
|
215 | 215 | |
216 | 216 | /** |
217 | 217 | * Retrieves a saved user address. |
@@ -220,14 +220,14 @@ discard block |
||
220 | 220 | * @param bool $with_default Whether or not we should use the default country and state. |
221 | 221 | * @return array |
222 | 222 | */ |
223 | -function wpinv_get_user_address( $user_id = 0, $with_default = true ) { |
|
223 | +function wpinv_get_user_address($user_id = 0, $with_default = true) { |
|
224 | 224 | |
225 | 225 | // Prepare the user id. |
226 | - $user_id = empty( $user_id ) ? get_current_user_id() : $user_id; |
|
227 | - $user_info = get_userdata( $user_id ); |
|
226 | + $user_id = empty($user_id) ? get_current_user_id() : $user_id; |
|
227 | + $user_info = get_userdata($user_id); |
|
228 | 228 | |
229 | 229 | // Abort if non exists. |
230 | - if ( empty( $user_info ) ) { |
|
230 | + if (empty($user_info)) { |
|
231 | 231 | return array(); |
232 | 232 | } |
233 | 233 | |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | 'email' => $user_info->user_email, |
238 | 238 | ); |
239 | 239 | |
240 | - foreach ( array_keys( getpaid_user_address_fields() ) as $field ) { |
|
241 | - $address[$field] = getpaid_get_user_address_field( $user_id, $field ); |
|
240 | + foreach (array_keys(getpaid_user_address_fields()) as $field) { |
|
241 | + $address[$field] = getpaid_get_user_address_field($user_id, $field); |
|
242 | 242 | } |
243 | 243 | |
244 | - if ( ! $with_default ) { |
|
244 | + if (!$with_default) { |
|
245 | 245 | return $address; |
246 | 246 | } |
247 | 247 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | 'country' => wpinv_get_default_country(), |
253 | 253 | ); |
254 | 254 | |
255 | - return getpaid_array_merge_if_empty( $address, $defaults ); |
|
255 | + return getpaid_array_merge_if_empty($address, $defaults); |
|
256 | 256 | |
257 | 257 | } |
258 | 258 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * @param string $field The field to use. |
264 | 264 | * @return string|null |
265 | 265 | */ |
266 | -function getpaid_get_user_address_field( $user_id, $field ) { |
|
266 | +function getpaid_get_user_address_field($user_id, $field) { |
|
267 | 267 | |
268 | 268 | $prefixes = array( |
269 | 269 | '_wpinv_', |
@@ -271,15 +271,15 @@ discard block |
||
271 | 271 | '' |
272 | 272 | ); |
273 | 273 | |
274 | - foreach ( $prefixes as $prefix ) { |
|
274 | + foreach ($prefixes as $prefix) { |
|
275 | 275 | |
276 | 276 | // Meta table. |
277 | - $value = get_user_meta( $user_id, $prefix . $field, true ); |
|
277 | + $value = get_user_meta($user_id, $prefix . $field, true); |
|
278 | 278 | |
279 | 279 | // UWP table. |
280 | - $value = ( empty( $value ) && function_exists( 'uwp_get_usermeta' ) ) ? uwp_get_usermeta( $user_id, $prefix . $field ) : $value; |
|
280 | + $value = (empty($value) && function_exists('uwp_get_usermeta')) ? uwp_get_usermeta($user_id, $prefix . $field) : $value; |
|
281 | 281 | |
282 | - if ( ! empty( $value ) ) { |
|
282 | + if (!empty($value)) { |
|
283 | 283 | return $value; |
284 | 284 | } |
285 | 285 | |
@@ -296,16 +296,16 @@ discard block |
||
296 | 296 | * @param string $return What to return. |
297 | 297 | * @return array |
298 | 298 | */ |
299 | -function wpinv_get_continents( $return = 'all' ) { |
|
299 | +function wpinv_get_continents($return = 'all') { |
|
300 | 300 | |
301 | - $continents = wpinv_get_data( 'continents' ); |
|
301 | + $continents = wpinv_get_data('continents'); |
|
302 | 302 | |
303 | - switch( $return ) { |
|
303 | + switch ($return) { |
|
304 | 304 | case 'name' : |
305 | - return wp_list_pluck( $continents, 'name' ); |
|
305 | + return wp_list_pluck($continents, 'name'); |
|
306 | 306 | break; |
307 | 307 | case 'countries' : |
308 | - return wp_list_pluck( $continents, 'countries' ); |
|
308 | + return wp_list_pluck($continents, 'countries'); |
|
309 | 309 | break; |
310 | 310 | default : |
311 | 311 | return $continents; |
@@ -321,12 +321,12 @@ discard block |
||
321 | 321 | * @param string $country Country code. If no code is specified, defaults to the default country. |
322 | 322 | * @return string |
323 | 323 | */ |
324 | -function wpinv_get_continent_code_for_country( $country = false ) { |
|
324 | +function wpinv_get_continent_code_for_country($country = false) { |
|
325 | 325 | |
326 | - $country = wpinv_sanitize_country( $country ); |
|
326 | + $country = wpinv_sanitize_country($country); |
|
327 | 327 | |
328 | - foreach ( wpinv_get_continents( 'countries' ) as $continent_code => $countries ) { |
|
329 | - if ( false !== array_search( $country, $countries, true ) ) { |
|
328 | + foreach (wpinv_get_continents('countries') as $continent_code => $countries) { |
|
329 | + if (false !== array_search($country, $countries, true)) { |
|
330 | 330 | return $continent_code; |
331 | 331 | } |
332 | 332 | } |
@@ -342,13 +342,13 @@ discard block |
||
342 | 342 | * @param string $country Country code. If no code is specified, defaults to the default country. |
343 | 343 | * @return array |
344 | 344 | */ |
345 | -function wpinv_get_country_calling_code( $country = null) { |
|
345 | +function wpinv_get_country_calling_code($country = null) { |
|
346 | 346 | |
347 | - $country = wpinv_sanitize_country( $country ); |
|
348 | - $codes = wpinv_get_data( 'phone-codes' ); |
|
349 | - $code = isset( $codes[ $country ] ) ? $codes[ $country ] : ''; |
|
347 | + $country = wpinv_sanitize_country($country); |
|
348 | + $codes = wpinv_get_data('phone-codes'); |
|
349 | + $code = isset($codes[$country]) ? $codes[$country] : ''; |
|
350 | 350 | |
351 | - if ( is_array( $code ) ) { |
|
351 | + if (is_array($code)) { |
|
352 | 352 | return $code[0]; |
353 | 353 | } |
354 | 354 | return $code; |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | * @param bool $first_empty Whether or not the first item in the list should be empty |
362 | 362 | * @return array |
363 | 363 | */ |
364 | -function wpinv_get_country_list( $first_empty = false ) { |
|
365 | - return wpinv_maybe_add_empty_option( apply_filters( 'wpinv_countries', wpinv_get_data( 'countries' ) ), $first_empty ); |
|
364 | +function wpinv_get_country_list($first_empty = false) { |
|
365 | + return wpinv_maybe_add_empty_option(apply_filters('wpinv_countries', wpinv_get_data('countries')), $first_empty); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
@@ -372,22 +372,22 @@ discard block |
||
372 | 372 | * @param bool $first_empty Whether or not the first item in the list should be empty |
373 | 373 | * @return array |
374 | 374 | */ |
375 | -function wpinv_get_country_states( $country = null, $first_empty = false ) { |
|
375 | +function wpinv_get_country_states($country = null, $first_empty = false) { |
|
376 | 376 | |
377 | 377 | // Prepare the country. |
378 | - $country = wpinv_sanitize_country( $country ); |
|
378 | + $country = wpinv_sanitize_country($country); |
|
379 | 379 | |
380 | 380 | // Fetch all states. |
381 | - $all_states = wpinv_get_data( 'states' ); |
|
381 | + $all_states = wpinv_get_data('states'); |
|
382 | 382 | |
383 | 383 | // Fetch the specified country's states. |
384 | - $states = isset( $all_states[ $country ] ) ? $all_states[ $country ] : array() ; |
|
385 | - $states = apply_filters( "wpinv_{$country}_states", $states ); |
|
386 | - $states = apply_filters( 'wpinv_country_states', $states, $country ); |
|
384 | + $states = isset($all_states[$country]) ? $all_states[$country] : array(); |
|
385 | + $states = apply_filters("wpinv_{$country}_states", $states); |
|
386 | + $states = apply_filters('wpinv_country_states', $states, $country); |
|
387 | 387 | |
388 | - asort( $states ); |
|
388 | + asort($states); |
|
389 | 389 | |
390 | - return wpinv_maybe_add_empty_option( $states, $first_empty ); |
|
390 | + return wpinv_maybe_add_empty_option($states, $first_empty); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @return array |
398 | 398 | */ |
399 | 399 | function wpinv_get_us_states_list() { |
400 | - return apply_filters( 'wpinv_usa_states', wpinv_get_country_states( 'US' ) ); |
|
400 | + return apply_filters('wpinv_usa_states', wpinv_get_country_states('US')); |
|
401 | 401 | } |
402 | 402 | |
403 | 403 | /** |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | * @return array |
408 | 408 | */ |
409 | 409 | function wpinv_get_canada_states_list() { |
410 | - return apply_filters( 'wpinv_canada_provinces', wpinv_get_country_states( 'CA' ) ); |
|
410 | + return apply_filters('wpinv_canada_provinces', wpinv_get_country_states('CA')); |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | /** |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | * @return array |
418 | 418 | */ |
419 | 419 | function wpinv_get_australia_states_list() { |
420 | - return apply_filters( 'wpinv_australia_states', wpinv_get_country_states( 'AU' ) ); |
|
420 | + return apply_filters('wpinv_australia_states', wpinv_get_country_states('AU')); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | * @return array |
428 | 428 | */ |
429 | 429 | function wpinv_get_bangladesh_states_list() { |
430 | - return apply_filters( 'wpinv_bangladesh_states', wpinv_get_country_states( 'BD' ) ); |
|
430 | + return apply_filters('wpinv_bangladesh_states', wpinv_get_country_states('BD')); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | /** |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @return array |
438 | 438 | */ |
439 | 439 | function wpinv_get_brazil_states_list() { |
440 | - return apply_filters( 'wpinv_brazil_states', wpinv_get_country_states( 'BR' ) ); |
|
440 | + return apply_filters('wpinv_brazil_states', wpinv_get_country_states('BR')); |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | /** |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | * @return array |
448 | 448 | */ |
449 | 449 | function wpinv_get_bulgaria_states_list() { |
450 | - return apply_filters( 'wpinv_bulgaria_states', wpinv_get_country_states( 'BG' ) ); |
|
450 | + return apply_filters('wpinv_bulgaria_states', wpinv_get_country_states('BG')); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | /** |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | * @return array |
458 | 458 | */ |
459 | 459 | function wpinv_get_hong_kong_states_list() { |
460 | - return apply_filters( 'wpinv_hong_kong_states', wpinv_get_country_states( 'HK' ) ); |
|
460 | + return apply_filters('wpinv_hong_kong_states', wpinv_get_country_states('HK')); |
|
461 | 461 | } |
462 | 462 | |
463 | 463 | /** |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | * @return array |
468 | 468 | */ |
469 | 469 | function wpinv_get_hungary_states_list() { |
470 | - return apply_filters( 'wpinv_hungary_states', wpinv_get_country_states( 'HU' ) ); |
|
470 | + return apply_filters('wpinv_hungary_states', wpinv_get_country_states('HU')); |
|
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | * @return array |
478 | 478 | */ |
479 | 479 | function wpinv_get_japan_states_list() { |
480 | - return apply_filters( 'wpinv_japan_states', wpinv_get_country_states( 'JP' ) ); |
|
480 | + return apply_filters('wpinv_japan_states', wpinv_get_country_states('JP')); |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | /** |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | * @return array |
488 | 488 | */ |
489 | 489 | function wpinv_get_china_states_list() { |
490 | - return apply_filters( 'wpinv_china_states', wpinv_get_country_states( 'CN' ) ); |
|
490 | + return apply_filters('wpinv_china_states', wpinv_get_country_states('CN')); |
|
491 | 491 | } |
492 | 492 | |
493 | 493 | /** |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | * @return array |
498 | 498 | */ |
499 | 499 | function wpinv_get_new_zealand_states_list() { |
500 | - return apply_filters( 'wpinv_new_zealand_states', wpinv_get_country_states( 'NZ' ) ); |
|
500 | + return apply_filters('wpinv_new_zealand_states', wpinv_get_country_states('NZ')); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | /** |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | * @return array |
508 | 508 | */ |
509 | 509 | function wpinv_get_peru_states_list() { |
510 | - return apply_filters( 'wpinv_peru_states', wpinv_get_country_states( 'PE' ) ); |
|
510 | + return apply_filters('wpinv_peru_states', wpinv_get_country_states('PE')); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | /** |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | * @return array |
518 | 518 | */ |
519 | 519 | function wpinv_get_indonesia_states_list() { |
520 | - return apply_filters( 'wpinv_indonesia_states', wpinv_get_country_states( 'ID' ) ); |
|
520 | + return apply_filters('wpinv_indonesia_states', wpinv_get_country_states('ID')); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | /** |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | * @return array |
528 | 528 | */ |
529 | 529 | function wpinv_get_india_states_list() { |
530 | - return apply_filters( 'wpinv_india_states', wpinv_get_country_states( 'IN' ) ); |
|
530 | + return apply_filters('wpinv_india_states', wpinv_get_country_states('IN')); |
|
531 | 531 | } |
532 | 532 | |
533 | 533 | /** |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | * @return array |
538 | 538 | */ |
539 | 539 | function wpinv_get_iran_states_list() { |
540 | - return apply_filters( 'wpinv_iran_states', wpinv_get_country_states( 'IR' ) ); |
|
540 | + return apply_filters('wpinv_iran_states', wpinv_get_country_states('IR')); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | /** |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | * @return array |
548 | 548 | */ |
549 | 549 | function wpinv_get_italy_states_list() { |
550 | - return apply_filters( 'wpinv_italy_states', wpinv_get_country_states( 'IT' ) ); |
|
550 | + return apply_filters('wpinv_italy_states', wpinv_get_country_states('IT')); |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | /** |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | * @return array |
558 | 558 | */ |
559 | 559 | function wpinv_get_malaysia_states_list() { |
560 | - return apply_filters( 'wpinv_malaysia_states', wpinv_get_country_states( 'MY' ) ); |
|
560 | + return apply_filters('wpinv_malaysia_states', wpinv_get_country_states('MY')); |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | /** |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | * @return array |
568 | 568 | */ |
569 | 569 | function wpinv_get_mexico_states_list() { |
570 | - return apply_filters( 'wpinv_mexico_states', wpinv_get_country_states( 'MX' ) ); |
|
570 | + return apply_filters('wpinv_mexico_states', wpinv_get_country_states('MX')); |
|
571 | 571 | } |
572 | 572 | |
573 | 573 | /** |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | * @return array |
578 | 578 | */ |
579 | 579 | function wpinv_get_nepal_states_list() { |
580 | - return apply_filters( 'wpinv_nepal_states', wpinv_get_country_states( 'NP' ) ); |
|
580 | + return apply_filters('wpinv_nepal_states', wpinv_get_country_states('NP')); |
|
581 | 581 | } |
582 | 582 | |
583 | 583 | /** |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | * @return array |
588 | 588 | */ |
589 | 589 | function wpinv_get_south_africa_states_list() { |
590 | - return apply_filters( 'wpinv_south_africa_states', wpinv_get_country_states( 'ZA' ) ); |
|
590 | + return apply_filters('wpinv_south_africa_states', wpinv_get_country_states('ZA')); |
|
591 | 591 | } |
592 | 592 | |
593 | 593 | /** |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | * @return array |
598 | 598 | */ |
599 | 599 | function wpinv_get_thailand_states_list() { |
600 | - return apply_filters( 'wpinv_thailand_states', wpinv_get_country_states( 'TH' ) ); |
|
600 | + return apply_filters('wpinv_thailand_states', wpinv_get_country_states('TH')); |
|
601 | 601 | } |
602 | 602 | |
603 | 603 | /** |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | * @return array |
608 | 608 | */ |
609 | 609 | function wpinv_get_turkey_states_list() { |
610 | - return apply_filters( 'wpinv_turkey_states', wpinv_get_country_states( 'TR' ) ); |
|
610 | + return apply_filters('wpinv_turkey_states', wpinv_get_country_states('TR')); |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | /** |
@@ -617,28 +617,28 @@ discard block |
||
617 | 617 | * @return array |
618 | 618 | */ |
619 | 619 | function wpinv_get_spain_states_list() { |
620 | - return apply_filters( 'wpinv_spain_states', wpinv_get_country_states( 'ES' ) ); |
|
620 | + return apply_filters('wpinv_spain_states', wpinv_get_country_states('ES')); |
|
621 | 621 | } |
622 | 622 | |
623 | 623 | function wpinv_get_states_field() { |
624 | - if( empty( $_POST['country'] ) ) { |
|
624 | + if (empty($_POST['country'])) { |
|
625 | 625 | $_POST['country'] = wpinv_get_default_country(); |
626 | 626 | } |
627 | - $states = wpinv_get_country_states( sanitize_text_field( $_POST['country'] ) ); |
|
627 | + $states = wpinv_get_country_states(sanitize_text_field($_POST['country'])); |
|
628 | 628 | |
629 | - if( !empty( $states ) ) { |
|
630 | - $sanitized_field_name = sanitize_text_field( $_POST['field_name'] ); |
|
629 | + if (!empty($states)) { |
|
630 | + $sanitized_field_name = sanitize_text_field($_POST['field_name']); |
|
631 | 631 | |
632 | 632 | $args = array( |
633 | 633 | 'name' => $sanitized_field_name, |
634 | 634 | 'id' => $sanitized_field_name, |
635 | 635 | 'class' => $sanitized_field_name . 'custom-select wpinv-select wpi_select2', |
636 | - 'options' => array_merge( array( '' => '' ), $states ), |
|
636 | + 'options' => array_merge(array('' => ''), $states), |
|
637 | 637 | 'show_option_all' => false, |
638 | 638 | 'show_option_none' => false |
639 | 639 | ); |
640 | 640 | |
641 | - $response = wpinv_html_select( $args ); |
|
641 | + $response = wpinv_html_select($args); |
|
642 | 642 | |
643 | 643 | } else { |
644 | 644 | $response = 'nostates'; |
@@ -647,10 +647,10 @@ discard block |
||
647 | 647 | return $response; |
648 | 648 | } |
649 | 649 | |
650 | -function wpinv_default_billing_country( $country = '', $user_id = 0 ) { |
|
651 | - $country = !empty( $country ) ? $country : wpinv_get_default_country(); |
|
650 | +function wpinv_default_billing_country($country = '', $user_id = 0) { |
|
651 | + $country = !empty($country) ? $country : wpinv_get_default_country(); |
|
652 | 652 | |
653 | - return apply_filters( 'wpinv_default_billing_country', $country, $user_id ); |
|
653 | + return apply_filters('wpinv_default_billing_country', $country, $user_id); |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | /** |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | */ |
663 | 663 | function wpinv_get_address_formats() { |
664 | 664 | |
665 | - return apply_filters( 'wpinv_localisation_address_formats', |
|
665 | + return apply_filters('wpinv_localisation_address_formats', |
|
666 | 666 | array( |
667 | 667 | 'default' => "{{name}}\n{{company}}\n{{address}}\n{{city}}\n{{state}}\n{{zip}}\n{{country}}", |
668 | 668 | 'AU' => "{{name}}\n{{company}}\n{{address}}\n{{city}}\n{{state}} {{zip}}\n{{country}}", |
@@ -711,9 +711,9 @@ discard block |
||
711 | 711 | * @see `wpinv_get_invoice_address_replacements` |
712 | 712 | * @return string |
713 | 713 | */ |
714 | -function wpinv_get_full_address_format( $country = false) { |
|
714 | +function wpinv_get_full_address_format($country = false) { |
|
715 | 715 | |
716 | - if( empty( $country ) ) { |
|
716 | + if (empty($country)) { |
|
717 | 717 | $country = wpinv_get_default_country(); |
718 | 718 | } |
719 | 719 | |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | $formats = wpinv_get_address_formats(); |
722 | 722 | |
723 | 723 | // Get format for the specified country. |
724 | - $format = ( $country && isset( $formats[ $country ] ) ) ? $formats[ $country ] : $formats['default']; |
|
724 | + $format = ($country && isset($formats[$country])) ? $formats[$country] : $formats['default']; |
|
725 | 725 | |
726 | 726 | /** |
727 | 727 | * Filters the address format to use on Invoices. |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | * @param string $format The address format to use. |
734 | 734 | * @param string $country The country who's address format is being retrieved. |
735 | 735 | */ |
736 | - return apply_filters( 'wpinv_get_full_address_format', $format, $country ); |
|
736 | + return apply_filters('wpinv_get_full_address_format', $format, $country); |
|
737 | 737 | } |
738 | 738 | |
739 | 739 | /** |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | * @param array $billing_details customer's billing details |
745 | 745 | * @return array |
746 | 746 | */ |
747 | -function wpinv_get_invoice_address_replacements( $billing_details ) { |
|
747 | +function wpinv_get_invoice_address_replacements($billing_details) { |
|
748 | 748 | |
749 | 749 | $default_args = array( |
750 | 750 | 'address' => '', |
@@ -757,22 +757,22 @@ discard block |
||
757 | 757 | 'company' => '', |
758 | 758 | ); |
759 | 759 | |
760 | - $args = map_deep( wp_parse_args( $billing_details, $default_args ), 'trim' ); |
|
760 | + $args = map_deep(wp_parse_args($billing_details, $default_args), 'trim'); |
|
761 | 761 | $state = $args['state']; |
762 | 762 | $country = $args['country']; |
763 | 763 | |
764 | 764 | // Handle full country name. |
765 | - $full_country = empty( $country ) ? $country : wpinv_country_name( $country ); |
|
765 | + $full_country = empty($country) ? $country : wpinv_country_name($country); |
|
766 | 766 | |
767 | 767 | // Handle full state name. |
768 | - $full_state = ( $country && $state ) ? wpinv_state_name( $state, $country ) : $state; |
|
768 | + $full_state = ($country && $state) ? wpinv_state_name($state, $country) : $state; |
|
769 | 769 | |
770 | 770 | $args['postcode'] = $args['zip']; |
771 | 771 | $args['name'] = $args['first_name'] . ' ' . $args['last_name']; |
772 | 772 | $args['state'] = $full_state; |
773 | 773 | $args['state_code'] = $state; |
774 | 774 | $args['country'] = $full_country; |
775 | - $args['country_code']= $country; |
|
775 | + $args['country_code'] = $country; |
|
776 | 776 | |
777 | 777 | /** |
778 | 778 | * Filters the address format replacements to use on Invoices. |
@@ -783,14 +783,14 @@ discard block |
||
783 | 783 | * @param array $replacements The address replacements to use. |
784 | 784 | * @param array $billing_details The billing details to use. |
785 | 785 | */ |
786 | - $replacements = apply_filters( 'wpinv_get_invoice_address_replacements', $args, $billing_details ); |
|
786 | + $replacements = apply_filters('wpinv_get_invoice_address_replacements', $args, $billing_details); |
|
787 | 787 | |
788 | 788 | $return = array(); |
789 | 789 | |
790 | - foreach( $replacements as $key => $value ) { |
|
791 | - $value = is_scalar( $value ) ? trim( sanitize_text_field( $value ) ) : ''; |
|
790 | + foreach ($replacements as $key => $value) { |
|
791 | + $value = is_scalar($value) ? trim(sanitize_text_field($value)) : ''; |
|
792 | 792 | $return['{{' . $key . '}}'] = $value; |
793 | - $return['{{' . $key . '_upper}}'] = wpinv_utf8_strtoupper( $value ); |
|
793 | + $return['{{' . $key . '_upper}}'] = wpinv_utf8_strtoupper($value); |
|
794 | 794 | } |
795 | 795 | |
796 | 796 | return $return; |
@@ -804,6 +804,6 @@ discard block |
||
804 | 804 | * @since 1.0.14 |
805 | 805 | * @return string |
806 | 806 | */ |
807 | -function wpinv_trim_formatted_address_line( $line ) { |
|
808 | - return trim( $line, ', ' ); |
|
807 | +function wpinv_trim_formatted_address_line($line) { |
|
808 | + return trim($line, ', '); |
|
809 | 809 | } |
810 | 810 | \ No newline at end of file |
@@ -15,20 +15,20 @@ discard block |
||
15 | 15 | * @package GetPaid |
16 | 16 | */ |
17 | 17 | |
18 | -defined( 'ABSPATH' ) || exit; |
|
18 | +defined('ABSPATH') || exit; |
|
19 | 19 | |
20 | 20 | // Define constants. |
21 | -if ( ! defined( 'WPINV_PLUGIN_FILE' ) ) { |
|
22 | - define( 'WPINV_PLUGIN_FILE', __FILE__ ); |
|
21 | +if (!defined('WPINV_PLUGIN_FILE')) { |
|
22 | + define('WPINV_PLUGIN_FILE', __FILE__); |
|
23 | 23 | } |
24 | 24 | |
25 | -if ( ! defined( 'WPINV_VERSION' ) ) { |
|
26 | - define( 'WPINV_VERSION', '2.1.5' ); |
|
25 | +if (!defined('WPINV_VERSION')) { |
|
26 | + define('WPINV_VERSION', '2.1.5'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // Include the main Invoicing class. |
30 | -if ( ! class_exists( 'WPInv_Plugin', false ) ) { |
|
31 | - require_once plugin_dir_path( WPINV_PLUGIN_FILE ) . 'includes/class-wpinv.php'; |
|
30 | +if (!class_exists('WPInv_Plugin', false)) { |
|
31 | + require_once plugin_dir_path(WPINV_PLUGIN_FILE) . 'includes/class-wpinv.php'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | function getpaid() { |
41 | 41 | |
42 | - if ( empty( $GLOBALS['invoicing'] ) ) { |
|
42 | + if (empty($GLOBALS['invoicing'])) { |
|
43 | 43 | $GLOBALS['invoicing'] = new WPInv_Plugin(); |
44 | 44 | } |
45 | 45 | |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | * @since 2.0.8 |
53 | 53 | */ |
54 | 54 | function getpaid_deactivation_hook() { |
55 | - update_option( 'wpinv_flush_permalinks', 1 ); |
|
55 | + update_option('wpinv_flush_permalinks', 1); |
|
56 | 56 | } |
57 | -register_deactivation_hook( __FILE__, 'getpaid_deactivation_hook' ); |
|
57 | +register_deactivation_hook(__FILE__, 'getpaid_deactivation_hook'); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @deprecated |
@@ -64,4 +64,4 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | // Kickstart the plugin. |
67 | -add_action( 'plugins_loaded', 'getpaid', -100 ); |
|
67 | +add_action('plugins_loaded', 'getpaid', -100); |
@@ -8,24 +8,24 @@ discard block |
||
8 | 8 | * @version 1.0.19 |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | // Prepare the due date reminder options. |
14 | 14 | $overdue_days_options = array(); |
15 | -$overdue_days_options['0'] = __( 'On the Due Date', 'invoicing' ); |
|
16 | -$overdue_days_options['1'] = __( '1 day after Due Date', 'invoicing' ); |
|
15 | +$overdue_days_options['0'] = __('On the Due Date', 'invoicing'); |
|
16 | +$overdue_days_options['1'] = __('1 day after Due Date', 'invoicing'); |
|
17 | 17 | |
18 | -for ( $i = 2; $i <= 10; $i++ ) { |
|
19 | - $overdue_days_options["$i"] = wp_sprintf( __( '%d days after Due Date', 'invoicing' ), $i ); |
|
18 | +for ($i = 2; $i <= 10; $i++) { |
|
19 | + $overdue_days_options["$i"] = wp_sprintf(__('%d days after Due Date', 'invoicing'), $i); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // Prepare up coming renewal reminder options. |
23 | 23 | $renewal_days_options = array(); |
24 | -$renewal_days_options['0'] = __( 'On the renewal date', 'invoicing' ); |
|
25 | -$renewal_days_options['1'] = __( '1 day before the renewal date', 'invoicing' ); |
|
24 | +$renewal_days_options['0'] = __('On the renewal date', 'invoicing'); |
|
25 | +$renewal_days_options['1'] = __('1 day before the renewal date', 'invoicing'); |
|
26 | 26 | |
27 | -for ( $i = 2; $i <= 10; $i++ ) { |
|
28 | - $renewal_days_options["$i"] = wp_sprintf( __( '%d days before the renewal date', 'invoicing' ), $i ); |
|
27 | +for ($i = 2; $i <= 10; $i++) { |
|
28 | + $renewal_days_options["$i"] = wp_sprintf(__('%d days before the renewal date', 'invoicing'), $i); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // Default, built-in gateways |
@@ -34,45 +34,45 @@ discard block |
||
34 | 34 | |
35 | 35 | 'email_new_invoice_header' => array( |
36 | 36 | 'id' => 'email_new_invoice_header', |
37 | - 'name' => '<h3>' . __( 'New Invoice', 'invoicing' ) . '</h3>', |
|
38 | - 'desc' => __( 'These emails are sent to the site admin whenever there is a new invoice.', 'invoicing' ), |
|
37 | + 'name' => '<h3>' . __('New Invoice', 'invoicing') . '</h3>', |
|
38 | + 'desc' => __('These emails are sent to the site admin whenever there is a new invoice.', 'invoicing'), |
|
39 | 39 | 'type' => 'header', |
40 | 40 | ), |
41 | 41 | |
42 | 42 | 'email_new_invoice_active' => array( |
43 | 43 | 'id' => 'email_new_invoice_active', |
44 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
45 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
44 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
45 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
46 | 46 | 'type' => 'checkbox', |
47 | 47 | 'std' => 1 |
48 | 48 | ), |
49 | 49 | |
50 | 50 | 'email_new_invoice_subject' => array( |
51 | 51 | 'id' => 'email_new_invoice_subject', |
52 | - 'name' => __( 'Subject', 'invoicing' ), |
|
53 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
52 | + 'name' => __('Subject', 'invoicing'), |
|
53 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
54 | 54 | 'help-tip' => true, |
55 | 55 | 'type' => 'text', |
56 | - 'std' => __( '[{site_title}] We sent your invoice ({invoice_number}) for {invoice_total} {invoice_currency}', 'invoicing' ), |
|
56 | + 'std' => __('[{site_title}] We sent your invoice ({invoice_number}) for {invoice_total} {invoice_currency}', 'invoicing'), |
|
57 | 57 | 'size' => 'large' |
58 | 58 | ), |
59 | 59 | |
60 | 60 | 'email_new_invoice_heading' => array( |
61 | 61 | 'id' => 'email_new_invoice_heading', |
62 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
63 | - 'desc' => __( 'Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing' ), |
|
62 | + 'name' => __('Email Heading', 'invoicing'), |
|
63 | + 'desc' => __('Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing'), |
|
64 | 64 | 'help-tip' => true, |
65 | 65 | 'type' => 'text', |
66 | - 'std' => __( 'Invoice sent', 'invoicing' ), |
|
66 | + 'std' => __('Invoice sent', 'invoicing'), |
|
67 | 67 | 'size' => 'large' |
68 | 68 | ), |
69 | 69 | |
70 | 70 | 'email_new_invoice_body' => array( |
71 | 71 | 'id' => 'email_new_invoice_body', |
72 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
73 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
72 | + 'name' => __('Email Content', 'invoicing'), |
|
73 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
74 | 74 | 'type' => 'rich_editor', |
75 | - 'std' => __( '<p>We sent your invoice <a href="{invoice_link}">({invoice_number})</a> to {name} for {invoice_total} {invoice_currency}.</p>', 'invoicing' ), |
|
75 | + 'std' => __('<p>We sent your invoice <a href="{invoice_link}">({invoice_number})</a> to {name} for {invoice_total} {invoice_currency}.</p>', 'invoicing'), |
|
76 | 76 | 'class' => 'large', |
77 | 77 | 'size' => '10' |
78 | 78 | ), |
@@ -82,45 +82,45 @@ discard block |
||
82 | 82 | |
83 | 83 | 'email_cancelled_invoice_header' => array( |
84 | 84 | 'id' => 'email_cancelled_invoice_header', |
85 | - 'name' => '<h3>' . __( 'Cancelled Invoice', 'invoicing' ) . '</h3>', |
|
86 | - 'desc' => __( 'These emails are sent to the site admin whenever invoices are cancelled.', 'invoicing' ), |
|
85 | + 'name' => '<h3>' . __('Cancelled Invoice', 'invoicing') . '</h3>', |
|
86 | + 'desc' => __('These emails are sent to the site admin whenever invoices are cancelled.', 'invoicing'), |
|
87 | 87 | 'type' => 'header', |
88 | 88 | ), |
89 | 89 | |
90 | 90 | 'email_cancelled_invoice_active' => array( |
91 | 91 | 'id' => 'email_cancelled_invoice_active', |
92 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
93 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
92 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
93 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
94 | 94 | 'type' => 'checkbox', |
95 | 95 | 'std' => 1 |
96 | 96 | ), |
97 | 97 | |
98 | 98 | 'email_cancelled_invoice_subject' => array( |
99 | 99 | 'id' => 'email_cancelled_invoice_subject', |
100 | - 'name' => __( 'Subject', 'invoicing' ), |
|
101 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
100 | + 'name' => __('Subject', 'invoicing'), |
|
101 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
102 | 102 | 'help-tip' => true, |
103 | 103 | 'type' => 'text', |
104 | - 'std' => __( '[{site_title}] Cancelled invoice ({invoice_number})', 'invoicing' ), |
|
104 | + 'std' => __('[{site_title}] Cancelled invoice ({invoice_number})', 'invoicing'), |
|
105 | 105 | 'size' => 'large' |
106 | 106 | ), |
107 | 107 | |
108 | 108 | 'email_cancelled_invoice_heading' => array( |
109 | 109 | 'id' => 'email_cancelled_invoice_heading', |
110 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
111 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
110 | + 'name' => __('Email Heading', 'invoicing'), |
|
111 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
112 | 112 | 'help-tip' => true, |
113 | 113 | 'type' => 'text', |
114 | - 'std' => __( 'Cancelled Invoice', 'invoicing' ), |
|
114 | + 'std' => __('Cancelled Invoice', 'invoicing'), |
|
115 | 115 | 'size' => 'large' |
116 | 116 | ), |
117 | 117 | |
118 | 118 | 'email_cancelled_invoice_body' => array( |
119 | 119 | 'id' => 'email_cancelled_invoice_body', |
120 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
121 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
120 | + 'name' => __('Email Content', 'invoicing'), |
|
121 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
122 | 122 | 'type' => 'rich_editor', |
123 | - 'std' => __( '<p>The invoice <a href="{invoice_link}">#{invoice_number}</a> created for {name} on {site_title} has been cancelled.</p>', 'invoicing' ), |
|
123 | + 'std' => __('<p>The invoice <a href="{invoice_link}">#{invoice_number}</a> created for {name} on {site_title} has been cancelled.</p>', 'invoicing'), |
|
124 | 124 | 'class' => 'large', |
125 | 125 | 'size' => '10' |
126 | 126 | ), |
@@ -131,45 +131,45 @@ discard block |
||
131 | 131 | |
132 | 132 | 'email_failed_invoice_header' => array( |
133 | 133 | 'id' => 'email_failed_invoice_header', |
134 | - 'name' => '<h3>' . __( 'Failed Invoice', 'invoicing' ) . '</h3>', |
|
135 | - 'desc' => __( 'Failed invoice emails are sent to the site admin when invoice payments fail.', 'invoicing' ), |
|
134 | + 'name' => '<h3>' . __('Failed Invoice', 'invoicing') . '</h3>', |
|
135 | + 'desc' => __('Failed invoice emails are sent to the site admin when invoice payments fail.', 'invoicing'), |
|
136 | 136 | 'type' => 'header', |
137 | 137 | ), |
138 | 138 | |
139 | 139 | 'email_failed_invoice_active' => array( |
140 | 140 | 'id' => 'email_failed_invoice_active', |
141 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
142 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
141 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
142 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
143 | 143 | 'type' => 'checkbox', |
144 | 144 | 'std' => 1 |
145 | 145 | ), |
146 | 146 | |
147 | 147 | 'email_failed_invoice_subject' => array( |
148 | 148 | 'id' => 'email_failed_invoice_subject', |
149 | - 'name' => __( 'Subject', 'invoicing' ), |
|
150 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
149 | + 'name' => __('Subject', 'invoicing'), |
|
150 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
151 | 151 | 'help-tip' => true, |
152 | 152 | 'type' => 'text', |
153 | - 'std' => __( '[{site_title}] Failed invoice ({invoice_number})', 'invoicing' ), |
|
153 | + 'std' => __('[{site_title}] Failed invoice ({invoice_number})', 'invoicing'), |
|
154 | 154 | 'size' => 'large' |
155 | 155 | ), |
156 | 156 | |
157 | 157 | 'email_failed_invoice_heading' => array( |
158 | 158 | 'id' => 'email_failed_invoice_heading', |
159 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
160 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
159 | + 'name' => __('Email Heading', 'invoicing'), |
|
160 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
161 | 161 | 'help-tip' => true, |
162 | 162 | 'type' => 'text', |
163 | - 'std' => __( 'Failed invoice', 'invoicing' ), |
|
163 | + 'std' => __('Failed invoice', 'invoicing'), |
|
164 | 164 | 'size' => 'large' |
165 | 165 | ), |
166 | 166 | |
167 | 167 | 'email_failed_invoice_body' => array( |
168 | 168 | 'id' => 'email_failed_invoice_body', |
169 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
170 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
169 | + 'name' => __('Email Content', 'invoicing'), |
|
170 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
171 | 171 | 'type' => 'rich_editor', |
172 | - 'std' => __( '<p>Payment for the invoice <a href="{invoice_link}">#{invoice_number}</a> on {site_title} has failed to go through.</p>', 'invoicing' ), |
|
172 | + 'std' => __('<p>Payment for the invoice <a href="{invoice_link}">#{invoice_number}</a> on {site_title} has failed to go through.</p>', 'invoicing'), |
|
173 | 173 | 'class' => 'large', |
174 | 174 | 'size' => '10' |
175 | 175 | ), |
@@ -179,53 +179,53 @@ discard block |
||
179 | 179 | |
180 | 180 | 'email_onhold_invoice_header' => array( |
181 | 181 | 'id' => 'email_onhold_invoice_header', |
182 | - 'name' => '<h3>' . __( 'On Hold Invoice', 'invoicing' ) . '</h3>', |
|
183 | - 'desc' => __( 'These emails are sent to customers whenever their invoices are held.', 'invoicing' ), |
|
182 | + 'name' => '<h3>' . __('On Hold Invoice', 'invoicing') . '</h3>', |
|
183 | + 'desc' => __('These emails are sent to customers whenever their invoices are held.', 'invoicing'), |
|
184 | 184 | 'type' => 'header', |
185 | 185 | ), |
186 | 186 | |
187 | 187 | 'email_onhold_invoice_active' => array( |
188 | 188 | 'id' => 'email_onhold_invoice_active', |
189 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
190 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
189 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
190 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
191 | 191 | 'type' => 'checkbox', |
192 | 192 | 'std' => 1 |
193 | 193 | ), |
194 | 194 | |
195 | 195 | 'email_onhold_invoice_admin_bcc' => array( |
196 | 196 | 'id' => 'email_onhold_invoice_admin_bcc', |
197 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
198 | - 'desc' => __( 'Check if you want to send this notification email to site Admin.', 'invoicing' ), |
|
197 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
198 | + 'desc' => __('Check if you want to send this notification email to site Admin.', 'invoicing'), |
|
199 | 199 | 'type' => 'checkbox', |
200 | 200 | 'std' => 1 |
201 | 201 | ), |
202 | 202 | |
203 | 203 | 'email_onhold_invoice_subject' => array( |
204 | 204 | 'id' => 'email_onhold_invoice_subject', |
205 | - 'name' => __( 'Subject', 'invoicing' ), |
|
206 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
205 | + 'name' => __('Subject', 'invoicing'), |
|
206 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
207 | 207 | 'help-tip' => true, |
208 | 208 | 'type' => 'text', |
209 | - 'std' => __( '[{site_title}] Your invoice receipt from {invoice_date}', 'invoicing' ), |
|
209 | + 'std' => __('[{site_title}] Your invoice receipt from {invoice_date}', 'invoicing'), |
|
210 | 210 | 'size' => 'large' |
211 | 211 | ), |
212 | 212 | |
213 | 213 | 'email_onhold_invoice_heading' => array( |
214 | 214 | 'id' => 'email_onhold_invoice_heading', |
215 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
216 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
215 | + 'name' => __('Email Heading', 'invoicing'), |
|
216 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
217 | 217 | 'help-tip' => true, |
218 | 218 | 'type' => 'text', |
219 | - 'std' => __( 'Thank you for your invoice', 'invoicing' ), |
|
219 | + 'std' => __('Thank you for your invoice', 'invoicing'), |
|
220 | 220 | 'size' => 'large' |
221 | 221 | ), |
222 | 222 | |
223 | 223 | 'email_onhold_invoice_body' => array( |
224 | 224 | 'id' => 'email_onhold_invoice_body', |
225 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
226 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
225 | + 'name' => __('Email Content', 'invoicing'), |
|
226 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
227 | 227 | 'type' => 'rich_editor', |
228 | - 'std' => __( '<p>Hi {name},</p><p>Your invoice is on-hold and will be processed when we receive your payment.</p>', 'invoicing' ), |
|
228 | + 'std' => __('<p>Hi {name},</p><p>Your invoice is on-hold and will be processed when we receive your payment.</p>', 'invoicing'), |
|
229 | 229 | 'class' => 'large', |
230 | 230 | 'size' => '10' |
231 | 231 | ), |
@@ -236,53 +236,53 @@ discard block |
||
236 | 236 | |
237 | 237 | 'email_processing_invoice_header' => array( |
238 | 238 | 'id' => 'email_processing_invoice_header', |
239 | - 'name' => '<h3>' . __( 'Processing Invoice', 'invoicing' ) . '</h3>', |
|
240 | - 'desc' => __( 'These emails are sent to users whenever payments for their invoices are processing.', 'invoicing' ), |
|
239 | + 'name' => '<h3>' . __('Processing Invoice', 'invoicing') . '</h3>', |
|
240 | + 'desc' => __('These emails are sent to users whenever payments for their invoices are processing.', 'invoicing'), |
|
241 | 241 | 'type' => 'header', |
242 | 242 | ), |
243 | 243 | |
244 | 244 | 'email_processing_invoice_active' => array( |
245 | 245 | 'id' => 'email_processing_invoice_active', |
246 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
247 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
246 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
247 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
248 | 248 | 'type' => 'checkbox', |
249 | 249 | 'std' => 1 |
250 | 250 | ), |
251 | 251 | |
252 | 252 | 'email_processing_invoice_admin_bcc' => array( |
253 | 253 | 'id' => 'email_processing_invoice_admin_bcc', |
254 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
255 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
254 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
255 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
256 | 256 | 'type' => 'checkbox', |
257 | 257 | 'std' => 1 |
258 | 258 | ), |
259 | 259 | |
260 | 260 | 'email_processing_invoice_subject' => array( |
261 | 261 | 'id' => 'email_processing_invoice_subject', |
262 | - 'name' => __( 'Subject', 'invoicing' ), |
|
263 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
262 | + 'name' => __('Subject', 'invoicing'), |
|
263 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
264 | 264 | 'help-tip' => true, |
265 | 265 | 'type' => 'text', |
266 | - 'std' => __( '[{site_title}] Your invoice receipt from {invoice_date}', 'invoicing' ), |
|
266 | + 'std' => __('[{site_title}] Your invoice receipt from {invoice_date}', 'invoicing'), |
|
267 | 267 | 'size' => 'large' |
268 | 268 | ), |
269 | 269 | |
270 | 270 | 'email_processing_invoice_heading' => array( |
271 | 271 | 'id' => 'email_processing_invoice_heading', |
272 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
273 | - 'desc' => __( 'Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing' ), |
|
272 | + 'name' => __('Email Heading', 'invoicing'), |
|
273 | + 'desc' => __('Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing'), |
|
274 | 274 | 'help-tip' => true, |
275 | 275 | 'type' => 'text', |
276 | - 'std' => __( 'Thank you for your invoice', 'invoicing' ), |
|
276 | + 'std' => __('Thank you for your invoice', 'invoicing'), |
|
277 | 277 | 'size' => 'large' |
278 | 278 | ), |
279 | 279 | |
280 | 280 | 'email_processing_invoice_body' => array( |
281 | 281 | 'id' => 'email_processing_invoice_body', |
282 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
283 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
282 | + 'name' => __('Email Content', 'invoicing'), |
|
283 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
284 | 284 | 'type' => 'rich_editor', |
285 | - 'std' => __( '<p>Hi {name},</p><p>I would like to let you know that we have received and are currently processing your payment for the invoice <a href="{invoice_link}">#{invoice_number}</a> on {site_title}.</p>', 'invoicing' ), |
|
285 | + 'std' => __('<p>Hi {name},</p><p>I would like to let you know that we have received and are currently processing your payment for the invoice <a href="{invoice_link}">#{invoice_number}</a> on {site_title}.</p>', 'invoicing'), |
|
286 | 286 | 'class' => 'large', |
287 | 287 | 'size' => '10' |
288 | 288 | ), |
@@ -293,61 +293,61 @@ discard block |
||
293 | 293 | |
294 | 294 | 'email_completed_invoice_header' => array( |
295 | 295 | 'id' => 'email_completed_invoice_header', |
296 | - 'name' => '<h3>' . __( 'Paid Invoice', 'invoicing' ) . '</h3>', |
|
297 | - 'desc' => __( 'These emails are sent to customers when their invoices are marked as paid.', 'invoicing' ), |
|
296 | + 'name' => '<h3>' . __('Paid Invoice', 'invoicing') . '</h3>', |
|
297 | + 'desc' => __('These emails are sent to customers when their invoices are marked as paid.', 'invoicing'), |
|
298 | 298 | 'type' => 'header', |
299 | 299 | ), |
300 | 300 | |
301 | 301 | 'email_completed_invoice_active' => array( |
302 | 302 | 'id' => 'email_completed_invoice_active', |
303 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
304 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
303 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
304 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
305 | 305 | 'type' => 'checkbox', |
306 | 306 | 'std' => 1 |
307 | 307 | ), |
308 | 308 | |
309 | 309 | 'email_completed_invoice_renewal_active' => array( |
310 | 310 | 'id' => 'email_completed_invoice_renewal_active', |
311 | - 'name' => __( 'Enable renewal notification', 'invoicing' ), |
|
312 | - 'desc' => __( 'Should this email be sent for renewals too?', 'invoicing' ), |
|
311 | + 'name' => __('Enable renewal notification', 'invoicing'), |
|
312 | + 'desc' => __('Should this email be sent for renewals too?', 'invoicing'), |
|
313 | 313 | 'type' => 'checkbox', |
314 | 314 | 'std' => 1 |
315 | 315 | ), |
316 | 316 | |
317 | 317 | 'email_completed_invoice_admin_bcc' => array( |
318 | 318 | 'id' => 'email_completed_invoice_admin_bcc', |
319 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
320 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
319 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
320 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
321 | 321 | 'type' => 'checkbox', |
322 | 322 | 'std' => 1, |
323 | 323 | ), |
324 | 324 | |
325 | 325 | 'email_completed_invoice_subject' => array( |
326 | 326 | 'id' => 'email_completed_invoice_subject', |
327 | - 'name' => __( 'Subject', 'invoicing' ), |
|
328 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
327 | + 'name' => __('Subject', 'invoicing'), |
|
328 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
329 | 329 | 'help-tip' => true, |
330 | 330 | 'type' => 'text', |
331 | - 'std' => __( '[{site_title}] Your invoice from {invoice_date} has been paid', 'invoicing' ), |
|
331 | + 'std' => __('[{site_title}] Your invoice from {invoice_date} has been paid', 'invoicing'), |
|
332 | 332 | 'size' => 'large' |
333 | 333 | ), |
334 | 334 | |
335 | 335 | 'email_completed_invoice_heading' => array( |
336 | 336 | 'id' => 'email_completed_invoice_heading', |
337 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
338 | - 'desc' => __( 'Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing' ), |
|
337 | + 'name' => __('Email Heading', 'invoicing'), |
|
338 | + 'desc' => __('Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing'), |
|
339 | 339 | 'help-tip' => true, |
340 | 340 | 'type' => 'text', |
341 | - 'std' => __( 'Your invoice has been paid', 'invoicing' ), |
|
341 | + 'std' => __('Your invoice has been paid', 'invoicing'), |
|
342 | 342 | 'size' => 'large' |
343 | 343 | ), |
344 | 344 | |
345 | 345 | 'email_completed_invoice_body' => array( |
346 | 346 | 'id' => 'email_completed_invoice_body', |
347 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
348 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
347 | + 'name' => __('Email Content', 'invoicing'), |
|
348 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
349 | 349 | 'type' => 'rich_editor', |
350 | - 'std' => __( '<p>Hi {name},</p><p>Your recent invoice on {site_title} has been paid.</p>', 'invoicing' ), |
|
350 | + 'std' => __('<p>Hi {name},</p><p>Your recent invoice on {site_title} has been paid.</p>', 'invoicing'), |
|
351 | 351 | 'class' => 'large', |
352 | 352 | 'size' => '10' |
353 | 353 | ), |
@@ -358,53 +358,53 @@ discard block |
||
358 | 358 | |
359 | 359 | 'email_refunded_invoice_header' => array( |
360 | 360 | 'id' => 'email_refunded_invoice_header', |
361 | - 'name' => '<h3>' . __( 'Refunded Invoice', 'invoicing' ) . '</h3>', |
|
362 | - 'desc' => __( 'These emails are sent to users when their invoices are marked as refunded.', 'invoicing' ), |
|
361 | + 'name' => '<h3>' . __('Refunded Invoice', 'invoicing') . '</h3>', |
|
362 | + 'desc' => __('These emails are sent to users when their invoices are marked as refunded.', 'invoicing'), |
|
363 | 363 | 'type' => 'header', |
364 | 364 | ), |
365 | 365 | |
366 | 366 | 'email_refunded_invoice_active' => array( |
367 | 367 | 'id' => 'email_refunded_invoice_active', |
368 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
369 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
368 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
369 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
370 | 370 | 'type' => 'checkbox', |
371 | 371 | 'std' => 1 |
372 | 372 | ), |
373 | 373 | |
374 | 374 | 'email_refunded_invoice_admin_bcc' => array( |
375 | 375 | 'id' => 'email_refunded_invoice_admin_bcc', |
376 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
377 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
376 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
377 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
378 | 378 | 'type' => 'checkbox', |
379 | 379 | 'std' => 1 |
380 | 380 | ), |
381 | 381 | |
382 | 382 | 'email_refunded_invoice_subject' => array( |
383 | 383 | 'id' => 'email_refunded_invoice_subject', |
384 | - 'name' => __( 'Subject', 'invoicing' ), |
|
385 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
384 | + 'name' => __('Subject', 'invoicing'), |
|
385 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
386 | 386 | 'help-tip' => true, |
387 | 387 | 'type' => 'text', |
388 | - 'std' => __( '[{site_title}] Your invoice from {invoice_date} has been refunded', 'invoicing' ), |
|
388 | + 'std' => __('[{site_title}] Your invoice from {invoice_date} has been refunded', 'invoicing'), |
|
389 | 389 | 'size' => 'large' |
390 | 390 | ), |
391 | 391 | |
392 | 392 | 'email_refunded_invoice_heading' => array( |
393 | 393 | 'id' => 'email_refunded_invoice_heading', |
394 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
395 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
394 | + 'name' => __('Email Heading', 'invoicing'), |
|
395 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
396 | 396 | 'help-tip' => true, |
397 | 397 | 'type' => 'text', |
398 | - 'std' => __( 'Your invoice has been refunded', 'invoicing' ), |
|
398 | + 'std' => __('Your invoice has been refunded', 'invoicing'), |
|
399 | 399 | 'size' => 'large' |
400 | 400 | ), |
401 | 401 | |
402 | 402 | 'email_refunded_invoice_body' => array( |
403 | 403 | 'id' => 'email_refunded_invoice_body', |
404 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
405 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
404 | + 'name' => __('Email Content', 'invoicing'), |
|
405 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
406 | 406 | 'type' => 'rich_editor', |
407 | - 'std' => __( '<p>Hi {name},</p><p>Your invoice on {site_title} has been refunded.</p>', 'invoicing' ), |
|
407 | + 'std' => __('<p>Hi {name},</p><p>Your invoice on {site_title} has been refunded.</p>', 'invoicing'), |
|
408 | 408 | 'class' => 'large', |
409 | 409 | 'size' => '10' |
410 | 410 | ), |
@@ -415,53 +415,53 @@ discard block |
||
415 | 415 | |
416 | 416 | 'email_user_invoice_header' => array( |
417 | 417 | 'id' => 'email_user_invoice_header', |
418 | - 'name' => '<h3>' . __( 'Customer Invoice', 'invoicing' ) . '</h3>', |
|
419 | - 'desc' => __( 'These emails are sent to customers containing their invoice information and payment links.', 'invoicing' ), |
|
418 | + 'name' => '<h3>' . __('Customer Invoice', 'invoicing') . '</h3>', |
|
419 | + 'desc' => __('These emails are sent to customers containing their invoice information and payment links.', 'invoicing'), |
|
420 | 420 | 'type' => 'header', |
421 | 421 | ), |
422 | 422 | |
423 | 423 | 'email_user_invoice_active' => array( |
424 | 424 | 'id' => 'email_user_invoice_active', |
425 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
426 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
425 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
426 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
427 | 427 | 'type' => 'checkbox', |
428 | 428 | 'std' => 1 |
429 | 429 | ), |
430 | 430 | |
431 | 431 | 'email_user_invoice_admin_bcc' => array( |
432 | 432 | 'id' => 'email_user_invoice_admin_bcc', |
433 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
434 | - 'desc' => __( 'Check if you want to send a copy of this notification email to to the site admin.', 'invoicing' ), |
|
433 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
434 | + 'desc' => __('Check if you want to send a copy of this notification email to to the site admin.', 'invoicing'), |
|
435 | 435 | 'type' => 'checkbox', |
436 | 436 | 'std' => 0 |
437 | 437 | ), |
438 | 438 | |
439 | 439 | 'email_user_invoice_subject' => array( |
440 | 440 | 'id' => 'email_user_invoice_subject', |
441 | - 'name' => __( 'Subject', 'invoicing' ), |
|
442 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
441 | + 'name' => __('Subject', 'invoicing'), |
|
442 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
443 | 443 | 'help-tip' => true, |
444 | 444 | 'type' => 'text', |
445 | - 'std' => __( '[{site_title}] Your invoice from {invoice_date}', 'invoicing' ), |
|
445 | + 'std' => __('[{site_title}] Your invoice from {invoice_date}', 'invoicing'), |
|
446 | 446 | 'size' => 'large' |
447 | 447 | ), |
448 | 448 | |
449 | 449 | 'email_user_invoice_heading' => array( |
450 | 450 | 'id' => 'email_user_invoice_heading', |
451 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
452 | - 'desc' => __( 'Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing' ), |
|
451 | + 'name' => __('Email Heading', 'invoicing'), |
|
452 | + 'desc' => __('Enter the main heading contained within the email notification for the invoice receipt email.', 'invoicing'), |
|
453 | 453 | 'help-tip' => true, |
454 | 454 | 'type' => 'text', |
455 | - 'std' => __( 'Your invoice {invoice_number} details', 'invoicing' ), |
|
455 | + 'std' => __('Your invoice {invoice_number} details', 'invoicing'), |
|
456 | 456 | 'size' => 'large' |
457 | 457 | ), |
458 | 458 | |
459 | 459 | 'email_user_invoice_body' => array( |
460 | 460 | 'id' => 'email_user_invoice_body', |
461 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
462 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
461 | + 'name' => __('Email Content', 'invoicing'), |
|
462 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
463 | 463 | 'type' => 'rich_editor', |
464 | - 'std' => __( '<p>Hi {name},</p><p>An invoice of {invoice_total} has been created for you on {site_title}. You can <a href="{invoice_link}">view</a> or <a href="{invoice_pay_link}">pay</a> the invoice. Please reply to this email if you have any questions about the invoice.', 'invoicing' ), |
|
464 | + 'std' => __('<p>Hi {name},</p><p>An invoice of {invoice_total} has been created for you on {site_title}. You can <a href="{invoice_link}">view</a> or <a href="{invoice_pay_link}">pay</a> the invoice. Please reply to this email if you have any questions about the invoice.', 'invoicing'), |
|
465 | 465 | 'class' => 'large', |
466 | 466 | 'size' => '10' |
467 | 467 | ), |
@@ -471,53 +471,53 @@ discard block |
||
471 | 471 | |
472 | 472 | 'email_user_note_header' => array( |
473 | 473 | 'id' => 'email_user_note_header', |
474 | - 'name' => '<h3>' . __( 'Customer Note', 'invoicing' ) . '</h3>', |
|
475 | - 'desc' => __( 'These emails are sent when you add a customer note to an invoice/quote.', 'invoicing' ), |
|
474 | + 'name' => '<h3>' . __('Customer Note', 'invoicing') . '</h3>', |
|
475 | + 'desc' => __('These emails are sent when you add a customer note to an invoice/quote.', 'invoicing'), |
|
476 | 476 | 'type' => 'header', |
477 | 477 | ), |
478 | 478 | |
479 | 479 | 'email_user_note_active' => array( |
480 | 480 | 'id' => 'email_user_note_active', |
481 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
482 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
481 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
482 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
483 | 483 | 'type' => 'checkbox', |
484 | 484 | 'std' => 1 |
485 | 485 | ), |
486 | 486 | |
487 | 487 | 'email_user_note_admin_bcc' => array( |
488 | 488 | 'id' => 'email_user_note_admin_bcc', |
489 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
490 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
489 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
490 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
491 | 491 | 'type' => 'checkbox', |
492 | 492 | 'std' => 0 |
493 | 493 | ), |
494 | 494 | |
495 | 495 | 'email_user_note_subject' => array( |
496 | 496 | 'id' => 'email_user_note_subject', |
497 | - 'name' => __( 'Subject', 'invoicing' ), |
|
498 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
497 | + 'name' => __('Subject', 'invoicing'), |
|
498 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
499 | 499 | 'help-tip' => true, |
500 | 500 | 'type' => 'text', |
501 | - 'std' => __( '[{site_title}] Note added to your {invoice_label} #{invoice_number} from {invoice_date}', 'invoicing' ), |
|
501 | + 'std' => __('[{site_title}] Note added to your {invoice_label} #{invoice_number} from {invoice_date}', 'invoicing'), |
|
502 | 502 | 'size' => 'large' |
503 | 503 | ), |
504 | 504 | |
505 | 505 | 'email_user_note_heading' => array( |
506 | 506 | 'id' => 'email_user_note_heading', |
507 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
508 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
507 | + 'name' => __('Email Heading', 'invoicing'), |
|
508 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
509 | 509 | 'help-tip' => true, |
510 | 510 | 'type' => 'text', |
511 | - 'std' => __( 'A note has been added to your {invoice_label}', 'invoicing' ), |
|
511 | + 'std' => __('A note has been added to your {invoice_label}', 'invoicing'), |
|
512 | 512 | 'size' => 'large' |
513 | 513 | ), |
514 | 514 | |
515 | 515 | 'email_user_note_body' => array( |
516 | 516 | 'id' => 'email_user_note_body', |
517 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
518 | - 'desc' => __( 'The content of the email (wildcards and HTML are allowed).', 'invoicing' ), |
|
517 | + 'name' => __('Email Content', 'invoicing'), |
|
518 | + 'desc' => __('The content of the email (wildcards and HTML are allowed).', 'invoicing'), |
|
519 | 519 | 'type' => 'rich_editor', |
520 | - 'std' => __( '<p>Hi {name},</p><p>Following note has been added to your {invoice_label}:</p><blockquote class="wpinv-note">{customer_note}</blockquote>', 'invoicing' ), |
|
520 | + 'std' => __('<p>Hi {name},</p><p>Following note has been added to your {invoice_label}:</p><blockquote class="wpinv-note">{customer_note}</blockquote>', 'invoicing'), |
|
521 | 521 | 'class' => 'large', |
522 | 522 | 'size' => '10' |
523 | 523 | ), |
@@ -528,63 +528,63 @@ discard block |
||
528 | 528 | |
529 | 529 | 'email_overdue_header' => array( |
530 | 530 | 'id' => 'email_overdue_header', |
531 | - 'name' => '<h3>' . __( 'Payment Reminder', 'invoicing' ) . '</h3>', |
|
532 | - 'desc' => __( 'Payment reminder emails are sent to customers whenever their invoices are due.', 'invoicing' ), |
|
531 | + 'name' => '<h3>' . __('Payment Reminder', 'invoicing') . '</h3>', |
|
532 | + 'desc' => __('Payment reminder emails are sent to customers whenever their invoices are due.', 'invoicing'), |
|
533 | 533 | 'type' => 'header', |
534 | 534 | ), |
535 | 535 | |
536 | 536 | 'email_overdue_active' => array( |
537 | 537 | 'id' => 'email_overdue_active', |
538 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
539 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
538 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
539 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
540 | 540 | 'type' => 'checkbox', |
541 | 541 | 'std' => 1 |
542 | 542 | ), |
543 | 543 | |
544 | 544 | 'email_overdue_admin_bcc' => array( |
545 | 545 | 'id' => 'email_overdue_admin_bcc', |
546 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
547 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
546 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
547 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
548 | 548 | 'type' => 'checkbox', |
549 | 549 | 'std' => 0 |
550 | 550 | ), |
551 | 551 | |
552 | 552 | 'email_overdue_days' => array( |
553 | 553 | 'id' => 'email_overdue_days', |
554 | - 'name' => __( 'When to Send', 'invoicing' ), |
|
555 | - 'desc' => __( 'Check when you would like payment reminders sent out.', 'invoicing' ), |
|
554 | + 'name' => __('When to Send', 'invoicing'), |
|
555 | + 'desc' => __('Check when you would like payment reminders sent out.', 'invoicing'), |
|
556 | 556 | 'help-tip' => true, |
557 | - 'std' => array( '1' ), |
|
557 | + 'std' => array('1'), |
|
558 | 558 | 'type' => 'multicheck', |
559 | 559 | 'options' => $overdue_days_options, |
560 | 560 | ), |
561 | 561 | |
562 | 562 | 'email_overdue_subject' => array( |
563 | 563 | 'id' => 'email_overdue_subject', |
564 | - 'name' => __( 'Subject', 'invoicing' ), |
|
565 | - 'desc' => __( 'Enter the subject line for the invoice receipt email.', 'invoicing' ), |
|
564 | + 'name' => __('Subject', 'invoicing'), |
|
565 | + 'desc' => __('Enter the subject line for the invoice receipt email.', 'invoicing'), |
|
566 | 566 | 'help-tip' => true, |
567 | 567 | 'type' => 'text', |
568 | - 'std' => __( '[{site_title}] Payment Reminder', 'invoicing' ), |
|
568 | + 'std' => __('[{site_title}] Payment Reminder', 'invoicing'), |
|
569 | 569 | 'size' => 'large' |
570 | 570 | ), |
571 | 571 | |
572 | 572 | 'email_overdue_heading' => array( |
573 | 573 | 'id' => 'email_overdue_heading', |
574 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
575 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
574 | + 'name' => __('Email Heading', 'invoicing'), |
|
575 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
576 | 576 | 'help-tip' => true, |
577 | 577 | 'type' => 'text', |
578 | - 'std' => __( 'Payment reminder for your invoice', 'invoicing' ), |
|
578 | + 'std' => __('Payment reminder for your invoice', 'invoicing'), |
|
579 | 579 | 'size' => 'large' |
580 | 580 | ), |
581 | 581 | |
582 | 582 | 'email_overdue_body' => array( |
583 | 583 | 'id' => 'email_overdue_body', |
584 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
585 | - 'desc' => __( 'The content of the email.', 'invoicing' ), |
|
584 | + 'name' => __('Email Content', 'invoicing'), |
|
585 | + 'desc' => __('The content of the email.', 'invoicing'), |
|
586 | 586 | 'type' => 'rich_editor', |
587 | - 'std' => __( '<p>Hi {full_name},</p><p>This is just a friendly reminder that your invoice <a href="{invoice_link}">#{invoice_number}</a> {is_was} due on {invoice_due_date}.</p><p>The total of this invoice is {invoice_total}</p><p>To view / pay now for this invoice please use the following link: <a class="btn btn-success" href="{invoice_link}">View / Pay</a></p>', 'invoicing' ), |
|
587 | + 'std' => __('<p>Hi {full_name},</p><p>This is just a friendly reminder that your invoice <a href="{invoice_link}">#{invoice_number}</a> {is_was} due on {invoice_due_date}.</p><p>The total of this invoice is {invoice_total}</p><p>To view / pay now for this invoice please use the following link: <a class="btn btn-success" href="{invoice_link}">View / Pay</a></p>', 'invoicing'), |
|
588 | 588 | 'class' => 'large', |
589 | 589 | 'size' => 10, |
590 | 590 | ), |
@@ -595,63 +595,63 @@ discard block |
||
595 | 595 | |
596 | 596 | 'email_renewal_reminder_header' => array( |
597 | 597 | 'id' => 'email_renewal_reminder_header', |
598 | - 'name' => '<h3>' . __( 'Renewal Reminder', 'invoicing' ) . '</h3>', |
|
599 | - 'desc' => __( 'These emails are sent to customers whenever their subscription is about to expire.', 'invoicing' ), |
|
598 | + 'name' => '<h3>' . __('Renewal Reminder', 'invoicing') . '</h3>', |
|
599 | + 'desc' => __('These emails are sent to customers whenever their subscription is about to expire.', 'invoicing'), |
|
600 | 600 | 'type' => 'header', |
601 | 601 | ), |
602 | 602 | |
603 | 603 | 'email_renewal_reminder_active' => array( |
604 | 604 | 'id' => 'email_renewal_reminder_active', |
605 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
606 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
605 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
606 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
607 | 607 | 'type' => 'checkbox', |
608 | 608 | 'std' => 0 |
609 | 609 | ), |
610 | 610 | |
611 | 611 | 'email_renewal_reminder_admin_bcc' => array( |
612 | 612 | 'id' => 'email_renewal_reminder_admin_bcc', |
613 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
614 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
613 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
614 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
615 | 615 | 'type' => 'checkbox', |
616 | 616 | 'std' => 0 |
617 | 617 | ), |
618 | 618 | |
619 | 619 | 'email_renewal_reminder_days' => array( |
620 | 620 | 'id' => 'email_renewal_reminder_days', |
621 | - 'name' => __( 'When to Send', 'invoicing' ), |
|
622 | - 'desc' => __( 'Check when you would like renewal reminders sent out.', 'invoicing' ), |
|
621 | + 'name' => __('When to Send', 'invoicing'), |
|
622 | + 'desc' => __('Check when you would like renewal reminders sent out.', 'invoicing'), |
|
623 | 623 | 'help-tip' => true, |
624 | - 'std' => array( '1', '5', '10' ), |
|
624 | + 'std' => array('1', '5', '10'), |
|
625 | 625 | 'type' => 'multicheck', |
626 | 626 | 'options' => $renewal_days_options, |
627 | 627 | ), |
628 | 628 | |
629 | 629 | 'email_renewal_reminder_subject' => array( |
630 | 630 | 'id' => 'email_renewal_reminder_subject', |
631 | - 'name' => __( 'Subject', 'invoicing' ), |
|
632 | - 'desc' => __( 'Enter the subject line for the email.', 'invoicing' ), |
|
631 | + 'name' => __('Subject', 'invoicing'), |
|
632 | + 'desc' => __('Enter the subject line for the email.', 'invoicing'), |
|
633 | 633 | 'help-tip' => true, |
634 | 634 | 'type' => 'text', |
635 | - 'std' => __( '[{site_title}] Renewal Reminder', 'invoicing' ), |
|
635 | + 'std' => __('[{site_title}] Renewal Reminder', 'invoicing'), |
|
636 | 636 | 'size' => 'large' |
637 | 637 | ), |
638 | 638 | |
639 | 639 | 'email_renewal_reminder_heading' => array( |
640 | 640 | 'id' => 'email_renewal_reminder_heading', |
641 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
642 | - 'desc' => __( 'Enter the main heading contained within the email notification.', 'invoicing' ), |
|
641 | + 'name' => __('Email Heading', 'invoicing'), |
|
642 | + 'desc' => __('Enter the main heading contained within the email notification.', 'invoicing'), |
|
643 | 643 | 'help-tip' => true, |
644 | 644 | 'type' => 'text', |
645 | - 'std' => __( 'Upcoming renewal reminder', 'invoicing' ), |
|
645 | + 'std' => __('Upcoming renewal reminder', 'invoicing'), |
|
646 | 646 | 'size' => 'large' |
647 | 647 | ), |
648 | 648 | |
649 | 649 | 'email_renewal_reminder_body' => array( |
650 | 650 | 'id' => 'email_renewal_reminder_body', |
651 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
652 | - 'desc' => __( 'The content of the email.', 'invoicing' ), |
|
651 | + 'name' => __('Email Content', 'invoicing'), |
|
652 | + 'desc' => __('The content of the email.', 'invoicing'), |
|
653 | 653 | 'type' => 'rich_editor', |
654 | - 'std' => __( '<p>Hi {full_name},</p><p>This is just a friendly reminder that your subscription for invoice <a href="{invoice_link}">#{invoice_number}</a> will renew on {subscription_renewal_date}.</p>', 'invoicing' ), |
|
654 | + 'std' => __('<p>Hi {full_name},</p><p>This is just a friendly reminder that your subscription for invoice <a href="{invoice_link}">#{invoice_number}</a> will renew on {subscription_renewal_date}.</p>', 'invoicing'), |
|
655 | 655 | 'class' => 'large', |
656 | 656 | 'size' => 10, |
657 | 657 | ), |
@@ -662,53 +662,53 @@ discard block |
||
662 | 662 | |
663 | 663 | 'email_subscription_trial_header' => array( |
664 | 664 | 'id' => 'email_subscription_trial_header', |
665 | - 'name' => '<h3>' . __( 'Trial Started', 'invoicing' ) . '</h3>', |
|
666 | - 'desc' => __( 'These emails are sent when a customer starts a subscription trial.', 'invoicing' ), |
|
665 | + 'name' => '<h3>' . __('Trial Started', 'invoicing') . '</h3>', |
|
666 | + 'desc' => __('These emails are sent when a customer starts a subscription trial.', 'invoicing'), |
|
667 | 667 | 'type' => 'header', |
668 | 668 | ), |
669 | 669 | |
670 | 670 | 'email_subscription_trial_active' => array( |
671 | 671 | 'id' => 'email_subscription_trial_active', |
672 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
673 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
672 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
673 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
674 | 674 | 'type' => 'checkbox', |
675 | 675 | 'std' => 0 |
676 | 676 | ), |
677 | 677 | |
678 | 678 | 'email_subscription_trial_admin_bcc' => array( |
679 | 679 | 'id' => 'email_subscription_trial_admin_bcc', |
680 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
681 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
680 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
681 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
682 | 682 | 'type' => 'checkbox', |
683 | 683 | 'std' => 0 |
684 | 684 | ), |
685 | 685 | |
686 | 686 | 'email_subscription_trial_subject' => array( |
687 | 687 | 'id' => 'email_subscription_trial_subject', |
688 | - 'name' => __( 'Subject', 'invoicing' ), |
|
689 | - 'desc' => __( 'Enter the subject line for the subscription trial email.', 'invoicing' ), |
|
688 | + 'name' => __('Subject', 'invoicing'), |
|
689 | + 'desc' => __('Enter the subject line for the subscription trial email.', 'invoicing'), |
|
690 | 690 | 'help-tip' => true, |
691 | 691 | 'type' => 'text', |
692 | - 'std' => __( '[{site_title}] Trial Started', 'invoicing' ), |
|
692 | + 'std' => __('[{site_title}] Trial Started', 'invoicing'), |
|
693 | 693 | 'size' => 'large' |
694 | 694 | ), |
695 | 695 | |
696 | 696 | 'email_subscription_trial_heading' => array( |
697 | 697 | 'id' => 'email_subscription_trial_heading', |
698 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
699 | - 'desc' => __( 'Enter the main heading of this email.', 'invoicing' ), |
|
698 | + 'name' => __('Email Heading', 'invoicing'), |
|
699 | + 'desc' => __('Enter the main heading of this email.', 'invoicing'), |
|
700 | 700 | 'help-tip' => true, |
701 | 701 | 'type' => 'text', |
702 | - 'std' => __( 'Trial Started', 'invoicing' ), |
|
702 | + 'std' => __('Trial Started', 'invoicing'), |
|
703 | 703 | 'size' => 'large' |
704 | 704 | ), |
705 | 705 | |
706 | 706 | 'email_subscription_trial_body' => array( |
707 | 707 | 'id' => 'email_subscription_trial_body', |
708 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
709 | - 'desc' => __( 'The content of the email.', 'invoicing' ), |
|
708 | + 'name' => __('Email Content', 'invoicing'), |
|
709 | + 'desc' => __('The content of the email.', 'invoicing'), |
|
710 | 710 | 'type' => 'rich_editor', |
711 | - 'std' => __( '<p>Hi {first_name},</p><p>Your trial for {subscription_name} is now active and will renew on {subscription_renewal_date}.</p>', 'invoicing' ), |
|
711 | + 'std' => __('<p>Hi {first_name},</p><p>Your trial for {subscription_name} is now active and will renew on {subscription_renewal_date}.</p>', 'invoicing'), |
|
712 | 712 | 'class' => 'large', |
713 | 713 | 'size' => 10, |
714 | 714 | ), |
@@ -718,53 +718,53 @@ discard block |
||
718 | 718 | |
719 | 719 | 'email_subscription_cancelled_header' => array( |
720 | 720 | 'id' => 'email_subscription_cancelled_header', |
721 | - 'name' => '<h3>' . __( 'Subscription Cancelled', 'invoicing' ) . '</h3>', |
|
722 | - 'desc' => __( 'These emails are sent when a customer cancels their subscription.', 'invoicing' ), |
|
721 | + 'name' => '<h3>' . __('Subscription Cancelled', 'invoicing') . '</h3>', |
|
722 | + 'desc' => __('These emails are sent when a customer cancels their subscription.', 'invoicing'), |
|
723 | 723 | 'type' => 'header', |
724 | 724 | ), |
725 | 725 | |
726 | 726 | 'email_subscription_cancelled_active' => array( |
727 | 727 | 'id' => 'email_subscription_cancelled_active', |
728 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
729 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
728 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
729 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
730 | 730 | 'type' => 'checkbox', |
731 | 731 | 'std' => 1 |
732 | 732 | ), |
733 | 733 | |
734 | 734 | 'email_subscription_cancelled_admin_bcc' => array( |
735 | 735 | 'id' => 'email_subscription_cancelled_admin_bcc', |
736 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
737 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
736 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
737 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
738 | 738 | 'type' => 'checkbox', |
739 | 739 | 'std' => 1 |
740 | 740 | ), |
741 | 741 | |
742 | 742 | 'email_subscription_cancelled_subject' => array( |
743 | 743 | 'id' => 'email_subscription_cancelled_subject', |
744 | - 'name' => __( 'Subject', 'invoicing' ), |
|
745 | - 'desc' => __( 'Enter the subject line for the subscription cancelled email.', 'invoicing' ), |
|
744 | + 'name' => __('Subject', 'invoicing'), |
|
745 | + 'desc' => __('Enter the subject line for the subscription cancelled email.', 'invoicing'), |
|
746 | 746 | 'help-tip' => true, |
747 | 747 | 'type' => 'text', |
748 | - 'std' => __( '[{site_title}] Subscription Cancelled', 'invoicing' ), |
|
748 | + 'std' => __('[{site_title}] Subscription Cancelled', 'invoicing'), |
|
749 | 749 | 'size' => 'large' |
750 | 750 | ), |
751 | 751 | |
752 | 752 | 'email_subscription_cancelled_heading' => array( |
753 | 753 | 'id' => 'email_subscription_cancelled_heading', |
754 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
755 | - 'desc' => __( 'Enter the main heading of this email.', 'invoicing' ), |
|
754 | + 'name' => __('Email Heading', 'invoicing'), |
|
755 | + 'desc' => __('Enter the main heading of this email.', 'invoicing'), |
|
756 | 756 | 'help-tip' => true, |
757 | 757 | 'type' => 'text', |
758 | - 'std' => __( 'Subscription Cancelled', 'invoicing' ), |
|
758 | + 'std' => __('Subscription Cancelled', 'invoicing'), |
|
759 | 759 | 'size' => 'large' |
760 | 760 | ), |
761 | 761 | |
762 | 762 | 'email_subscription_cancelled_body' => array( |
763 | 763 | 'id' => 'email_subscription_cancelled_body', |
764 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
765 | - 'desc' => __( 'The content of the email.', 'invoicing' ), |
|
764 | + 'name' => __('Email Content', 'invoicing'), |
|
765 | + 'desc' => __('The content of the email.', 'invoicing'), |
|
766 | 766 | 'type' => 'rich_editor', |
767 | - 'std' => __( '<p>Hi {first_name},</p><p>Your subscription for {subscription_name} has been cancelled and will no longer renew.</p>', 'invoicing' ), |
|
767 | + 'std' => __('<p>Hi {first_name},</p><p>Your subscription for {subscription_name} has been cancelled and will no longer renew.</p>', 'invoicing'), |
|
768 | 768 | 'class' => 'large', |
769 | 769 | 'size' => 10, |
770 | 770 | ), |
@@ -774,53 +774,53 @@ discard block |
||
774 | 774 | |
775 | 775 | 'email_subscription_expired_header' => array( |
776 | 776 | 'id' => 'email_subscription_expired_header', |
777 | - 'name' => '<h3>' . __( 'Subscription Expired', 'invoicing' ) . '</h3>', |
|
778 | - 'desc' => __( "These emails are sent when a customer's subscription expires and automatic renewal fails.", 'invoicing' ), |
|
777 | + 'name' => '<h3>' . __('Subscription Expired', 'invoicing') . '</h3>', |
|
778 | + 'desc' => __("These emails are sent when a customer's subscription expires and automatic renewal fails.", 'invoicing'), |
|
779 | 779 | 'type' => 'header', |
780 | 780 | ), |
781 | 781 | |
782 | 782 | 'email_subscription_expired_active' => array( |
783 | 783 | 'id' => 'email_subscription_expired_active', |
784 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
785 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
784 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
785 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
786 | 786 | 'type' => 'checkbox', |
787 | 787 | 'std' => 1 |
788 | 788 | ), |
789 | 789 | |
790 | 790 | 'email_subscription_expired_admin_bcc' => array( |
791 | 791 | 'id' => 'email_subscription_expired_admin_bcc', |
792 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
793 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
792 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
793 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
794 | 794 | 'type' => 'checkbox', |
795 | 795 | 'std' => 1 |
796 | 796 | ), |
797 | 797 | |
798 | 798 | 'email_subscription_expired_subject' => array( |
799 | 799 | 'id' => 'email_subscription_expired_subject', |
800 | - 'name' => __( 'Subject', 'invoicing' ), |
|
801 | - 'desc' => __( 'Enter the subject line for the subscription expired email.', 'invoicing' ), |
|
800 | + 'name' => __('Subject', 'invoicing'), |
|
801 | + 'desc' => __('Enter the subject line for the subscription expired email.', 'invoicing'), |
|
802 | 802 | 'help-tip' => true, |
803 | 803 | 'type' => 'text', |
804 | - 'std' => __( '[{site_title}] Subscription Expired', 'invoicing' ), |
|
804 | + 'std' => __('[{site_title}] Subscription Expired', 'invoicing'), |
|
805 | 805 | 'size' => 'large' |
806 | 806 | ), |
807 | 807 | |
808 | 808 | 'email_subscription_expired_heading' => array( |
809 | 809 | 'id' => 'email_subscription_expired_heading', |
810 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
811 | - 'desc' => __( 'Enter the main heading of this email.', 'invoicing' ), |
|
810 | + 'name' => __('Email Heading', 'invoicing'), |
|
811 | + 'desc' => __('Enter the main heading of this email.', 'invoicing'), |
|
812 | 812 | 'type' => 'text', |
813 | - 'std' => __( 'Subscription Expired', 'invoicing' ), |
|
813 | + 'std' => __('Subscription Expired', 'invoicing'), |
|
814 | 814 | 'help-tip' => true, |
815 | 815 | 'size' => 'large' |
816 | 816 | ), |
817 | 817 | |
818 | 818 | 'email_subscription_expired_body' => array( |
819 | 819 | 'id' => 'email_subscription_expired_body', |
820 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
821 | - 'desc' => __( 'The content of the email.', 'invoicing' ), |
|
820 | + 'name' => __('Email Content', 'invoicing'), |
|
821 | + 'desc' => __('The content of the email.', 'invoicing'), |
|
822 | 822 | 'type' => 'rich_editor', |
823 | - 'std' => __( '<p>Hi {first_name},</p><p>Your subscription for {subscription_name} has expired.</p>', 'invoicing' ), |
|
823 | + 'std' => __('<p>Hi {first_name},</p><p>Your subscription for {subscription_name} has expired.</p>', 'invoicing'), |
|
824 | 824 | 'class' => 'large', |
825 | 825 | 'size' => 10, |
826 | 826 | ), |
@@ -830,53 +830,53 @@ discard block |
||
830 | 830 | |
831 | 831 | 'email_subscription_complete_header' => array( |
832 | 832 | 'id' => 'email_subscription_complete_header', |
833 | - 'name' => '<h3>' . __( 'Subscription Complete', 'invoicing' ) . '</h3>', |
|
834 | - 'desc' => __( 'These emails are sent when a customer completes their subscription.', 'invoicing' ), |
|
833 | + 'name' => '<h3>' . __('Subscription Complete', 'invoicing') . '</h3>', |
|
834 | + 'desc' => __('These emails are sent when a customer completes their subscription.', 'invoicing'), |
|
835 | 835 | 'type' => 'header', |
836 | 836 | ), |
837 | 837 | |
838 | 838 | 'email_subscription_complete_active' => array( |
839 | 839 | 'id' => 'email_subscription_complete_active', |
840 | - 'name' => __( 'Enable/Disable', 'invoicing' ), |
|
841 | - 'desc' => __( 'Enable this email notification', 'invoicing' ), |
|
840 | + 'name' => __('Enable/Disable', 'invoicing'), |
|
841 | + 'desc' => __('Enable this email notification', 'invoicing'), |
|
842 | 842 | 'type' => 'checkbox', |
843 | 843 | 'std' => 1 |
844 | 844 | ), |
845 | 845 | |
846 | 846 | 'email_subscription_complete_admin_bcc' => array( |
847 | 847 | 'id' => 'email_subscription_complete_admin_bcc', |
848 | - 'name' => __( 'Enable Admin BCC', 'invoicing' ), |
|
849 | - 'desc' => __( 'Check if you want to send a copy of this notification email to the site admin.', 'invoicing' ), |
|
848 | + 'name' => __('Enable Admin BCC', 'invoicing'), |
|
849 | + 'desc' => __('Check if you want to send a copy of this notification email to the site admin.', 'invoicing'), |
|
850 | 850 | 'type' => 'checkbox', |
851 | 851 | 'std' => 1 |
852 | 852 | ), |
853 | 853 | |
854 | 854 | 'email_subscription_complete_subject' => array( |
855 | 855 | 'id' => 'email_subscription_complete_subject', |
856 | - 'name' => __( 'Subject', 'invoicing' ), |
|
857 | - 'desc' => __( 'Enter the subject line for the subscription complete email.', 'invoicing' ), |
|
856 | + 'name' => __('Subject', 'invoicing'), |
|
857 | + 'desc' => __('Enter the subject line for the subscription complete email.', 'invoicing'), |
|
858 | 858 | 'help-tip' => true, |
859 | 859 | 'type' => 'text', |
860 | - 'std' => __( '[{site_title}] Subscription Complete', 'invoicing' ), |
|
860 | + 'std' => __('[{site_title}] Subscription Complete', 'invoicing'), |
|
861 | 861 | 'size' => 'large' |
862 | 862 | ), |
863 | 863 | |
864 | 864 | 'email_subscription_complete_heading' => array( |
865 | 865 | 'id' => 'email_subscription_complete_heading', |
866 | - 'name' => __( 'Email Heading', 'invoicing' ), |
|
867 | - 'desc' => __( 'Enter the main heading of this email.', 'invoicing' ), |
|
866 | + 'name' => __('Email Heading', 'invoicing'), |
|
867 | + 'desc' => __('Enter the main heading of this email.', 'invoicing'), |
|
868 | 868 | 'help-tip' => true, |
869 | 869 | 'type' => 'text', |
870 | - 'std' => __( 'Subscription Complete', 'invoicing' ), |
|
870 | + 'std' => __('Subscription Complete', 'invoicing'), |
|
871 | 871 | 'size' => 'large' |
872 | 872 | ), |
873 | 873 | |
874 | 874 | 'email_subscription_complete_body' => array( |
875 | 875 | 'id' => 'email_subscription_complete_body', |
876 | - 'name' => __( 'Email Content', 'invoicing' ), |
|
877 | - 'desc' => __( 'The content of the email.', 'invoicing' ), |
|
876 | + 'name' => __('Email Content', 'invoicing'), |
|
877 | + 'desc' => __('The content of the email.', 'invoicing'), |
|
878 | 878 | 'type' => 'rich_editor', |
879 | - 'std' => __( '<p>Hi {first_name},</p><p>Your subscription for {subscription_name} is now complete.</p>', 'invoicing' ), |
|
879 | + 'std' => __('<p>Hi {first_name},</p><p>Your subscription for {subscription_name} is now complete.</p>', 'invoicing'), |
|
880 | 880 | 'class' => 'large', |
881 | 881 | 'size' => 10, |
882 | 882 | ), |