@@ -8,18 +8,18 @@ |
||
8 | 8 | * @var WPInv_Subscription $object |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $invoice = $object->get_parent_payment(); |
14 | 14 | |
15 | 15 | // Print the email header. |
16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
17 | 17 | |
18 | 18 | // Generate the custom message body. |
19 | 19 | echo $message_body; |
20 | 20 | |
21 | 21 | // Print the billing details. |
22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
23 | 23 | |
24 | 24 | // Print the email footer. |
25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
@@ -8,18 +8,18 @@ |
||
8 | 8 | * @var WPInv_Subscription $object |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $invoice = $object->get_parent_payment(); |
14 | 14 | |
15 | 15 | // Print the email header. |
16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
17 | 17 | |
18 | 18 | // Generate the custom message body. |
19 | 19 | echo $message_body; |
20 | 20 | |
21 | 21 | // Print the billing details. |
22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
23 | 23 | |
24 | 24 | // Print the email footer. |
25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
@@ -8,18 +8,18 @@ |
||
8 | 8 | * @var WPInv_Subscription $object |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | $invoice = $object->get_parent_payment(); |
14 | 14 | |
15 | 15 | // Print the email header. |
16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
17 | 17 | |
18 | 18 | // Generate the custom message body. |
19 | 19 | echo $message_body; |
20 | 20 | |
21 | 21 | // Print the billing details. |
22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
23 | 23 | |
24 | 24 | // Print the email footer. |
25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // MUST have WordPress. |
10 | -if ( !defined( 'WPINC' ) ) { |
|
10 | +if (!defined('WPINC')) { |
|
11 | 11 | exit; |
12 | 12 | } |
13 | 13 | |
@@ -24,40 +24,40 @@ discard block |
||
24 | 24 | * @param Array $assoc_args Key value arguments stored in associated array format. |
25 | 25 | * @since 1.0.13 |
26 | 26 | */ |
27 | - public function insert_invoice( $args, $assoc_args ) { |
|
27 | + public function insert_invoice($args, $assoc_args) { |
|
28 | 28 | |
29 | 29 | // Fetch invoice data from the args |
30 | - $invoice_data = wp_unslash( $assoc_args ); |
|
30 | + $invoice_data = wp_unslash($assoc_args); |
|
31 | 31 | |
32 | 32 | // Abort if no invoice data is provided |
33 | - if( empty( $invoice_data ) ) { |
|
34 | - return WP_CLI::error( __( 'Invoice data not provided', 'invoicing' ) ); |
|
33 | + if (empty($invoice_data)) { |
|
34 | + return WP_CLI::error(__('Invoice data not provided', 'invoicing')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | //Cart details |
38 | - if( !empty( $invoice_data['cart_details'] ) ) { |
|
39 | - $invoice_data['cart_details'] = json_decode( $invoice_data['cart_details'], true ); |
|
38 | + if (!empty($invoice_data['cart_details'])) { |
|
39 | + $invoice_data['cart_details'] = json_decode($invoice_data['cart_details'], true); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | //User details |
43 | - if( !empty( $invoice_data['user_info'] ) ) { |
|
44 | - $invoice_data['user_info'] = json_decode( $invoice_data['user_info'], true ); |
|
43 | + if (!empty($invoice_data['user_info'])) { |
|
44 | + $invoice_data['user_info'] = json_decode($invoice_data['user_info'], true); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | //Payment info |
48 | - if( !empty( $invoice_data['payment_details'] ) ) { |
|
49 | - $invoice_data['payment_details'] = json_decode( $invoice_data['payment_details'], true ); |
|
48 | + if (!empty($invoice_data['payment_details'])) { |
|
49 | + $invoice_data['payment_details'] = json_decode($invoice_data['payment_details'], true); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // Try creating the invoice |
53 | - $invoice = wpinv_insert_invoice( $invoice_data, true ); |
|
53 | + $invoice = wpinv_insert_invoice($invoice_data, true); |
|
54 | 54 | |
55 | - if ( is_wp_error( $invoice ) ) { |
|
56 | - return WP_CLI::error( $invoice->get_error_message() ); |
|
55 | + if (is_wp_error($invoice)) { |
|
56 | + return WP_CLI::error($invoice->get_error_message()); |
|
57 | 57 | } |
58 | 58 | |
59 | - $message = sprintf( __( 'Invoice %s created', 'invoicing' ), $invoice->get_id() ); |
|
60 | - WP_CLI::success( $message ); |
|
59 | + $message = sprintf(__('Invoice %s created', 'invoicing'), $invoice->get_id()); |
|
60 | + WP_CLI::success($message); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 |
@@ -8,23 +8,23 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | 15 | <div class='form-group'> |
16 | - <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e( 'Heading', 'invoicing' ) ?></label> |
|
16 | + <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e('Heading', 'invoicing') ?></label> |
|
17 | 17 | <input :id="active_form_element.id + '_edit_heading'" v-model='active_form_element.text' class='form-control' type='text' /> |
18 | 18 | </div> |
19 | 19 | |
20 | 20 | <div class='form-group'> |
21 | - <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e( 'Select Heading Level', 'invoicing' ) ?></label> |
|
21 | + <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e('Select Heading Level', 'invoicing') ?></label> |
|
22 | 22 | <select class='form-control custom-select' :id="active_form_element.id + '_edit_level'" v-model='active_form_element.level'> |
23 | - <option value='h1'><?php esc_html_e( 'H1', 'invoicing' ); ?></option> |
|
24 | - <option value='h2'><?php esc_html_e( 'H2', 'invoicing' ); ?></option> |
|
25 | - <option value='h3'><?php esc_html_e( 'H3', 'invoicing' ); ?></option> |
|
26 | - <option value='h4'><?php esc_html_e( 'H4', 'invoicing' ); ?></option> |
|
27 | - <option value='h5'><?php esc_html_e( 'H5', 'invoicing' ); ?></option> |
|
28 | - <option value='h6'><?php esc_html_e( 'H6', 'invoicing' ); ?></option> |
|
23 | + <option value='h1'><?php esc_html_e('H1', 'invoicing'); ?></option> |
|
24 | + <option value='h2'><?php esc_html_e('H2', 'invoicing'); ?></option> |
|
25 | + <option value='h3'><?php esc_html_e('H3', 'invoicing'); ?></option> |
|
26 | + <option value='h4'><?php esc_html_e('H4', 'invoicing'); ?></option> |
|
27 | + <option value='h5'><?php esc_html_e('H5', 'invoicing'); ?></option> |
|
28 | + <option value='h6'><?php esc_html_e('H6', 'invoicing'); ?></option> |
|
29 | 29 | </select> |
30 | 30 | </div> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @version 1.0.19 |
6 | 6 | */ |
7 | 7 | |
8 | -defined( 'ABSPATH' ) || exit; |
|
8 | +defined('ABSPATH') || exit; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * REST API invoices controller class. |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | |
54 | 54 | 'customers' => array( |
55 | - 'description' => __( 'Limit result set to invoices for specific user ids.', 'invoicing' ), |
|
55 | + 'description' => __('Limit result set to invoices for specific user ids.', 'invoicing'), |
|
56 | 56 | 'type' => 'array', |
57 | 57 | 'items' => array( |
58 | 58 | 'type' => 'integer', |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | ), |
63 | 63 | |
64 | 64 | 'exclude_customers' => array( |
65 | - 'description' => __( 'Exclude invoices to specific users.', 'invoicing' ), |
|
65 | + 'description' => __('Exclude invoices to specific users.', 'invoicing'), |
|
66 | 66 | 'type' => 'array', |
67 | 67 | 'items' => array( |
68 | 68 | 'type' => 'integer', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ), |
73 | 73 | |
74 | 74 | 'parent' => array( |
75 | - 'description' => __( 'Limit result set to those of particular parent IDs.', 'invoicing' ), |
|
75 | + 'description' => __('Limit result set to those of particular parent IDs.', 'invoicing'), |
|
76 | 76 | 'type' => 'array', |
77 | 77 | 'items' => array( |
78 | 78 | 'type' => 'integer', |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ), |
83 | 83 | |
84 | 84 | 'parent_exclude' => array( |
85 | - 'description' => __( 'Limit result set to all items except those of a particular parent ID.', 'invoicing' ), |
|
85 | + 'description' => __('Limit result set to all items except those of a particular parent ID.', 'invoicing'), |
|
86 | 86 | 'type' => 'array', |
87 | 87 | 'items' => array( |
88 | 88 | 'type' => 'integer', |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ); |
97 | 97 | |
98 | 98 | // Filter collection parameters for the invoices controller. |
99 | - return apply_filters( 'getpaid_rest_invoices_collection_params', $params, $this ); |
|
99 | + return apply_filters('getpaid_rest_invoices_collection_params', $params, $this); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -107,21 +107,21 @@ discard block |
||
107 | 107 | * @param WP_REST_Request $request Request object. |
108 | 108 | * @return array $query_args |
109 | 109 | */ |
110 | - protected function prepare_items_query( $prepared_args = array(), $request = null ) { |
|
110 | + protected function prepare_items_query($prepared_args = array(), $request = null) { |
|
111 | 111 | |
112 | - $query_args = parent::prepare_items_query( $prepared_args ); |
|
112 | + $query_args = parent::prepare_items_query($prepared_args); |
|
113 | 113 | |
114 | 114 | // Retrieve invoices for specific customers. |
115 | - if ( ! empty( $request['customers'] ) ) { |
|
115 | + if (!empty($request['customers'])) { |
|
116 | 116 | $query_args['author__in'] = $request['customers']; |
117 | 117 | } |
118 | 118 | |
119 | 119 | // Skip invoices for specific customers. |
120 | - if ( ! empty( $request['exclude_customers'] ) ) { |
|
120 | + if (!empty($request['exclude_customers'])) { |
|
121 | 121 | $query_args['author__not_in'] = $request['exclude_customers']; |
122 | 122 | } |
123 | 123 | |
124 | - return apply_filters( 'getpaid_rest_invoices_prepare_items_query', $query_args, $request, $this ); |
|
124 | + return apply_filters('getpaid_rest_invoices_prepare_items_query', $query_args, $request, $this); |
|
125 | 125 | |
126 | 126 | } |
127 | 127 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @return array A list of registered item statuses. |
134 | 134 | */ |
135 | 135 | public function get_post_statuses() { |
136 | - return array_keys( wpinv_get_invoice_statuses( true, false, $this->post_type ) ); |
|
136 | + return array_keys(wpinv_get_invoice_statuses(true, false, $this->post_type)); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -142,9 +142,9 @@ discard block |
||
142 | 142 | * @param WPInv_Invoice $invoice Invoice to save. |
143 | 143 | * @return WP_Error|WPInv_Invoice |
144 | 144 | */ |
145 | - protected function save_object( $invoice ) { |
|
145 | + protected function save_object($invoice) { |
|
146 | 146 | $invoice->recalculate_total(); |
147 | - return parent::save_object( $invoice ); |
|
147 | + return parent::save_object($invoice); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | $issues = array(); |
6 | 6 | |
7 | 7 | if (!(PHP_VERSION_ID >= 50600)) { |
8 | - $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.'; |
|
8 | + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.6.0". You are running ' . PHP_VERSION . '.'; |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | if ($issues) { |
@@ -7,13 +7,13 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='wpinv-address-wrapper row'> |
15 | 15 | |
16 | - <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php _e( 'Billing / Shipping Address', 'invoicing' ); ?></h4> |
|
16 | + <h4 v-if="form_element.address_type == 'both'" class="col-12 mb-3"><?php _e('Billing / Shipping Address', 'invoicing'); ?></h4> |
|
17 | 17 | |
18 | 18 | <div class='form-group address-field-preview wpinv-payment-form-field-preview' v-for='(field, index) in visible_fields( form_element.fields )' :class='grid_class( field )' :key='field.name'> |
19 | 19 | <label class="d-block w-100"> |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * |
6 | 6 | */ |
7 | 7 | |
8 | -defined( 'ABSPATH' ) || exit; |
|
8 | +defined('ABSPATH') || exit; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * GetPaid_Reports_Abstract_Report Class. |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | public function get_range() { |
33 | 33 | $valid_ranges = $this->get_periods(); |
34 | 34 | |
35 | - if ( isset( $_GET['date_range'] ) && array_key_exists( $_GET['date_range'], $valid_ranges ) ) { |
|
36 | - return sanitize_key( $_GET['date_range'] ); |
|
35 | + if (isset($_GET['date_range']) && array_key_exists($_GET['date_range'], $valid_ranges)) { |
|
36 | + return sanitize_key($_GET['date_range']); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return '7_days'; |
@@ -47,37 +47,37 @@ discard block |
||
47 | 47 | public function get_periods() { |
48 | 48 | |
49 | 49 | $periods = array( |
50 | - 'today' => __( 'Today', 'invoicing' ), |
|
51 | - 'yesterday' => __( 'Yesterday', 'invoicing' ), |
|
52 | - '7_days' => __( 'Last 7 days', 'invoicing' ), |
|
53 | - '30_days' => __( 'Last 30 days', 'invoicing' ), |
|
54 | - '60_days' => __( 'Last 60 days', 'invoicing' ), |
|
55 | - '90_days' => __( 'Last 90 days', 'invoicing' ), |
|
56 | - '180_days' => __( 'Last 180 days', 'invoicing' ), |
|
57 | - '360_days' => __( 'Last 360 days', 'invoicing' ), |
|
50 | + 'today' => __('Today', 'invoicing'), |
|
51 | + 'yesterday' => __('Yesterday', 'invoicing'), |
|
52 | + '7_days' => __('Last 7 days', 'invoicing'), |
|
53 | + '30_days' => __('Last 30 days', 'invoicing'), |
|
54 | + '60_days' => __('Last 60 days', 'invoicing'), |
|
55 | + '90_days' => __('Last 90 days', 'invoicing'), |
|
56 | + '180_days' => __('Last 180 days', 'invoicing'), |
|
57 | + '360_days' => __('Last 360 days', 'invoicing'), |
|
58 | 58 | ); |
59 | 59 | |
60 | - return apply_filters( 'getpaid_earning_periods', $periods ); |
|
60 | + return apply_filters('getpaid_earning_periods', $periods); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Retrieves the current range's sql. |
65 | 65 | * |
66 | 66 | */ |
67 | - public function get_range_sql( $range ) { |
|
67 | + public function get_range_sql($range) { |
|
68 | 68 | |
69 | - $date = 'CAST(meta.completed_date AS DATE)'; |
|
69 | + $date = 'CAST(meta.completed_date AS DATE)'; |
|
70 | 70 | $datetime = 'meta.completed_date'; |
71 | 71 | |
72 | 72 | // Prepare durations. |
73 | - $today = current_time( 'Y-m-d' ); |
|
74 | - $yesterday = date( 'Y-m-d', strtotime( '-1 day', current_time( 'timestamp' ) ) ); |
|
75 | - $seven_days_ago = date( 'Y-m-d', strtotime( '-7 days', current_time( 'timestamp' ) ) ); |
|
76 | - $thirty_days_ago = date( 'Y-m-d', strtotime( '-30 days', current_time( 'timestamp' ) ) ); |
|
77 | - $ninety_days_ago = date( 'Y-m-d', strtotime( '-90 days', current_time( 'timestamp' ) ) ); |
|
78 | - $sixty_days_ago = date( 'Y-m-d', strtotime( '-60 days', current_time( 'timestamp' ) ) ); |
|
79 | - $one_eighty_days_ago = date( 'Y-m-d', strtotime( '-180 days', current_time( 'timestamp' ) ) ); |
|
80 | - $three_sixty_days_ago = date( 'Y-m-d', strtotime( '-360 days', current_time( 'timestamp' ) ) ); |
|
73 | + $today = current_time('Y-m-d'); |
|
74 | + $yesterday = date('Y-m-d', strtotime('-1 day', current_time('timestamp'))); |
|
75 | + $seven_days_ago = date('Y-m-d', strtotime('-7 days', current_time('timestamp'))); |
|
76 | + $thirty_days_ago = date('Y-m-d', strtotime('-30 days', current_time('timestamp'))); |
|
77 | + $ninety_days_ago = date('Y-m-d', strtotime('-90 days', current_time('timestamp'))); |
|
78 | + $sixty_days_ago = date('Y-m-d', strtotime('-60 days', current_time('timestamp'))); |
|
79 | + $one_eighty_days_ago = date('Y-m-d', strtotime('-180 days', current_time('timestamp'))); |
|
80 | + $three_sixty_days_ago = date('Y-m-d', strtotime('-360 days', current_time('timestamp'))); |
|
81 | 81 | |
82 | 82 | $ranges = array( |
83 | 83 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | |
124 | 124 | ); |
125 | 125 | |
126 | - $sql = isset( $ranges[ $range ] ) ? $ranges[ $range ] : $ranges[ '7_days' ]; |
|
127 | - return apply_filters( 'getpaid_earning_graphs_get_range_sql', $sql, $range ); |
|
126 | + $sql = isset($ranges[$range]) ? $ranges[$range] : $ranges['7_days']; |
|
127 | + return apply_filters('getpaid_earning_graphs_get_range_sql', $sql, $range); |
|
128 | 128 | |
129 | 129 | } |
130 | 130 | |
@@ -135,30 +135,30 @@ discard block |
||
135 | 135 | public function get_hours_in_a_day() { |
136 | 136 | |
137 | 137 | return array( |
138 | - '12AM' => __( '12 AM', 'invoicing'), |
|
139 | - '1AM' => __( '1 AM', 'invoicing'), |
|
140 | - '2AM' => __( '2 AM', 'invoicing'), |
|
141 | - '3AM' => __( '3 AM', 'invoicing'), |
|
142 | - '4AM' => __( '4 AM', 'invoicing'), |
|
143 | - '5AM' => __( '5 AM', 'invoicing'), |
|
144 | - '6AM' => __( '6 AM', 'invoicing'), |
|
145 | - '7AM' => __( '7 AM', 'invoicing'), |
|
146 | - '8AM' => __( '8 AM', 'invoicing'), |
|
147 | - '9AM' => __( '9 AM', 'invoicing'), |
|
148 | - '10AM' => __( '10 AM', 'invoicing'), |
|
149 | - '11AM' => __( '11 AM', 'invoicing'), |
|
150 | - '12pm' => __( '12 PM', 'invoicing'), |
|
151 | - '1PM' => __( '1 PM', 'invoicing'), |
|
152 | - '2PM' => __( '2 PM', 'invoicing'), |
|
153 | - '3PM' => __( '3 PM', 'invoicing'), |
|
154 | - '4PM' => __( '4 PM', 'invoicing'), |
|
155 | - '5PM' => __( '5 PM', 'invoicing'), |
|
156 | - '6PM' => __( '6 PM', 'invoicing'), |
|
157 | - '7PM' => __( '7 PM', 'invoicing'), |
|
158 | - '8PM' => __( '8 PM', 'invoicing'), |
|
159 | - '9PM' => __( '9 PM', 'invoicing'), |
|
160 | - '10PM' => __( '10 PM', 'invoicing'), |
|
161 | - '11PM' => __( '11 PM', 'invoicing'), |
|
138 | + '12AM' => __('12 AM', 'invoicing'), |
|
139 | + '1AM' => __('1 AM', 'invoicing'), |
|
140 | + '2AM' => __('2 AM', 'invoicing'), |
|
141 | + '3AM' => __('3 AM', 'invoicing'), |
|
142 | + '4AM' => __('4 AM', 'invoicing'), |
|
143 | + '5AM' => __('5 AM', 'invoicing'), |
|
144 | + '6AM' => __('6 AM', 'invoicing'), |
|
145 | + '7AM' => __('7 AM', 'invoicing'), |
|
146 | + '8AM' => __('8 AM', 'invoicing'), |
|
147 | + '9AM' => __('9 AM', 'invoicing'), |
|
148 | + '10AM' => __('10 AM', 'invoicing'), |
|
149 | + '11AM' => __('11 AM', 'invoicing'), |
|
150 | + '12pm' => __('12 PM', 'invoicing'), |
|
151 | + '1PM' => __('1 PM', 'invoicing'), |
|
152 | + '2PM' => __('2 PM', 'invoicing'), |
|
153 | + '3PM' => __('3 PM', 'invoicing'), |
|
154 | + '4PM' => __('4 PM', 'invoicing'), |
|
155 | + '5PM' => __('5 PM', 'invoicing'), |
|
156 | + '6PM' => __('6 PM', 'invoicing'), |
|
157 | + '7PM' => __('7 PM', 'invoicing'), |
|
158 | + '8PM' => __('8 PM', 'invoicing'), |
|
159 | + '9PM' => __('9 PM', 'invoicing'), |
|
160 | + '10PM' => __('10 PM', 'invoicing'), |
|
161 | + '11PM' => __('11 PM', 'invoicing'), |
|
162 | 162 | ); |
163 | 163 | |
164 | 164 | } |
@@ -167,24 +167,24 @@ discard block |
||
167 | 167 | * Retrieves the days in a period |
168 | 168 | * |
169 | 169 | */ |
170 | - public function get_days_in_period( $days ) { |
|
170 | + public function get_days_in_period($days) { |
|
171 | 171 | |
172 | 172 | $return = array(); |
173 | 173 | $format = 'Y-m-d'; |
174 | 174 | |
175 | - if ( $days < 8 ) { |
|
175 | + if ($days < 8) { |
|
176 | 176 | $format = 'D'; |
177 | 177 | } |
178 | 178 | |
179 | - if ( $days < 32 ) { |
|
179 | + if ($days < 32) { |
|
180 | 180 | $format = 'M j'; |
181 | 181 | } |
182 | 182 | |
183 | - while ( $days > 0 ) { |
|
183 | + while ($days > 0) { |
|
184 | 184 | |
185 | - $key = date( 'Y-m-d', strtotime( "-$days days", current_time( 'timestamp' ) ) ); |
|
186 | - $label = date_i18n( $format, strtotime( "-$days days", current_time( 'timestamp' ) ) ); |
|
187 | - $return[ $key ] = $label; |
|
185 | + $key = date('Y-m-d', strtotime("-$days days", current_time('timestamp'))); |
|
186 | + $label = date_i18n($format, strtotime("-$days days", current_time('timestamp'))); |
|
187 | + $return[$key] = $label; |
|
188 | 188 | $days--; |
189 | 189 | |
190 | 190 | } |
@@ -196,15 +196,15 @@ discard block |
||
196 | 196 | * Retrieves the weeks in a period |
197 | 197 | * |
198 | 198 | */ |
199 | - public function get_weeks_in_period( $days ) { |
|
199 | + public function get_weeks_in_period($days) { |
|
200 | 200 | |
201 | 201 | $return = array(); |
202 | 202 | |
203 | - while ( $days > 0 ) { |
|
203 | + while ($days > 0) { |
|
204 | 204 | |
205 | - $key = date( 'W', strtotime( "-$days days", current_time( 'timestamp' ) ) ); |
|
206 | - $label = date_i18n( 'Y-m-d', strtotime( "-$days days", current_time( 'timestamp' ) ) ); |
|
207 | - $return[ $key ] = $label; |
|
205 | + $key = date('W', strtotime("-$days days", current_time('timestamp'))); |
|
206 | + $label = date_i18n('Y-m-d', strtotime("-$days days", current_time('timestamp'))); |
|
207 | + $return[$key] = $label; |
|
208 | 208 | $days--; |
209 | 209 | |
210 | 210 | } |