@@ -7,33 +7,33 @@ |
||
| 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='form-group'> |
| 15 | 15 | <label class="d-block"> |
| 16 | - <span><?php esc_html_e( 'Alert Text', 'invoicing' ); ?></span> |
|
| 16 | + <span><?php esc_html_e('Alert Text', 'invoicing'); ?></span> |
|
| 17 | 17 | <textarea v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
| 18 | 18 | </label> |
| 19 | 19 | </div> |
| 20 | 20 | |
| 21 | 21 | <div class='form-group form-check'> |
| 22 | 22 | <input :id="active_form_element.id + '_edit_dismissible'" v-model='active_form_element.dismissible' type='checkbox' class='form-check-input' /> |
| 23 | - <label class='form-check-label' :for="active_form_element.id + '_edit_dismissible'"><?php esc_html_e( 'Is Dismissible?', 'invoicing' ); ?></label> |
|
| 23 | + <label class='form-check-label' :for="active_form_element.id + '_edit_dismissible'"><?php esc_html_e('Is Dismissible?', 'invoicing'); ?></label> |
|
| 24 | 24 | </div> |
| 25 | 25 | |
| 26 | 26 | <div class='form-group'> |
| 27 | - <label :for="active_form_element.id + '_edit_type'"><?php esc_html_e( 'Alert Type', 'invoicing' ); ?></label> |
|
| 27 | + <label :for="active_form_element.id + '_edit_type'"><?php esc_html_e('Alert Type', 'invoicing'); ?></label> |
|
| 28 | 28 | <select class='form-control custom-select' :id="active_form_element.id + '_edit_type'" v-model='active_form_element.class'> |
| 29 | - <option value='alert-primary'><?php esc_html_e( 'Primary', 'invoicing' ); ?></option> |
|
| 30 | - <option value='alert-secondary'><?php esc_html_e( 'Secondary', 'invoicing' ); ?></option> |
|
| 31 | - <option value='alert-success'><?php esc_html_e( 'Success', 'invoicing' ); ?></option> |
|
| 32 | - <option value='alert-danger'><?php esc_html_e( 'Danger', 'invoicing' ); ?></option> |
|
| 33 | - <option value='alert-warning'><?php esc_html_e( 'Warning', 'invoicing' ); ?></option> |
|
| 34 | - <option value='alert-info'><?php esc_html_e( 'Info', 'invoicing' ); ?></option> |
|
| 35 | - <option value='alert-light'><?php esc_html_e( 'Light', 'invoicing' ); ?></option> |
|
| 36 | - <option value='alert-dark'><?php esc_html_e( 'Dark', 'invoicing' ); ?></option> |
|
| 37 | - <option value='alert-link'><?php esc_html_e( 'Link', 'invoicing' ); ?></option> |
|
| 29 | + <option value='alert-primary'><?php esc_html_e('Primary', 'invoicing'); ?></option> |
|
| 30 | + <option value='alert-secondary'><?php esc_html_e('Secondary', 'invoicing'); ?></option> |
|
| 31 | + <option value='alert-success'><?php esc_html_e('Success', 'invoicing'); ?></option> |
|
| 32 | + <option value='alert-danger'><?php esc_html_e('Danger', 'invoicing'); ?></option> |
|
| 33 | + <option value='alert-warning'><?php esc_html_e('Warning', 'invoicing'); ?></option> |
|
| 34 | + <option value='alert-info'><?php esc_html_e('Info', 'invoicing'); ?></option> |
|
| 35 | + <option value='alert-light'><?php esc_html_e('Light', 'invoicing'); ?></option> |
|
| 36 | + <option value='alert-dark'><?php esc_html_e('Dark', 'invoicing'); ?></option> |
|
| 37 | + <option value='alert-link'><?php esc_html_e('Link', 'invoicing'); ?></option> |
|
| 38 | 38 | </select> |
| 39 | 39 | </div> |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | 13 | <hr class="featurette-divider" /> |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | <component :is='form_element.level' v-html='form_element.text'></component> |
@@ -21,20 +21,20 @@ |
||
| 21 | 21 | |
| 22 | 22 | foreach ( $file_types as $file_type ) { |
| 23 | 23 | |
| 24 | - if ( isset( $all_types[ $file_type ] ) ) { |
|
| 25 | - $types[] = $all_types[ $file_type ]; |
|
| 26 | - $file_type = explode( '|', $file_type ); |
|
| 27 | - |
|
| 28 | - foreach ( $file_type as $type ) { |
|
| 29 | - $type = trim( $type ); |
|
| 30 | - $types[] = ".$type"; |
|
| 31 | - $_types[] = $type; |
|
| 32 | - } |
|
| 24 | + if ( isset( $all_types[ $file_type ] ) ) { |
|
| 25 | + $types[] = $all_types[ $file_type ]; |
|
| 26 | + $file_type = explode( '|', $file_type ); |
|
| 27 | + |
|
| 28 | + foreach ( $file_type as $type ) { |
|
| 29 | + $type = trim( $type ); |
|
| 30 | + $types[] = ".$type"; |
|
| 31 | + $_types[] = $type; |
|
| 32 | + } |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | if ( ! empty( $required ) ) { |
| 37 | - $label .= "<span class='text-danger'> *</span>"; |
|
| 37 | + $label .= "<span class='text-danger'> *</span>"; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | ?> |
@@ -7,33 +7,33 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | - |
|
| 12 | -$label = empty( $label ) ? '' : wp_kses_post( $label ); |
|
| 13 | -$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) ); |
|
| 14 | -$id = esc_attr( $id ); |
|
| 15 | -$_id = $id . uniqid( '_' ); |
|
| 16 | -$max_file_num = empty( $max_file_num ) ? 1 : absint( $max_file_num ); |
|
| 17 | -$file_types = empty( $file_types ) ? array( 'jpg|jpeg|jpe', 'gif', 'png' ) : $file_types; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | + |
|
| 12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
| 13 | +$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label)); |
|
| 14 | +$id = esc_attr($id); |
|
| 15 | +$_id = $id . uniqid('_'); |
|
| 16 | +$max_file_num = empty($max_file_num) ? 1 : absint($max_file_num); |
|
| 17 | +$file_types = empty($file_types) ? array('jpg|jpeg|jpe', 'gif', 'png') : $file_types; |
|
| 18 | 18 | $all_types = getpaid_get_allowed_mime_types(); |
| 19 | 19 | $types = array(); |
| 20 | 20 | $_types = array(); |
| 21 | 21 | |
| 22 | -foreach ( $file_types as $file_type ) { |
|
| 22 | +foreach ($file_types as $file_type) { |
|
| 23 | 23 | |
| 24 | - if ( isset( $all_types[ $file_type ] ) ) { |
|
| 25 | - $types[] = $all_types[ $file_type ]; |
|
| 26 | - $file_type = explode( '|', $file_type ); |
|
| 24 | + if (isset($all_types[$file_type])) { |
|
| 25 | + $types[] = $all_types[$file_type]; |
|
| 26 | + $file_type = explode('|', $file_type); |
|
| 27 | 27 | |
| 28 | - foreach ( $file_type as $type ) { |
|
| 29 | - $type = trim( $type ); |
|
| 28 | + foreach ($file_type as $type) { |
|
| 29 | + $type = trim($type); |
|
| 30 | 30 | $types[] = ".$type"; |
| 31 | 31 | $_types[] = $type; |
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -if ( ! empty( $required ) ) { |
|
| 36 | +if (!empty($required)) { |
|
| 37 | 37 | $label .= "<span class='text-danger'> *</span>"; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -41,16 +41,16 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | <label><span v-html="form_element.label"></span></label> |
| 43 | 43 | |
| 44 | -<div class="form-group <?php echo esc_attr( $label_class ); ?>" data-name="<?php echo esc_attr( $id ); ?>" data-max="<?php echo esc_attr( $max_file_num ); ?>"> |
|
| 45 | - <label for="<?php echo esc_attr( $id ); ?>"><?php echo wp_kses_post( $label ); ?></label> |
|
| 46 | - <input type="file" class="sr-only getpaid-files-input" id="<?php echo esc_attr( $id ); ?>" accept="<?php echo esc_attr( implode( ', ', $types ) ); ?>" data-extensions="<?php echo esc_attr( wp_json_encode( $_types ) ); ?>" <?php echo $max_file_num == 1 ? '' : 'multiple="multiple"'; ?>> |
|
| 44 | +<div class="form-group <?php echo esc_attr($label_class); ?>" data-name="<?php echo esc_attr($id); ?>" data-max="<?php echo esc_attr($max_file_num); ?>"> |
|
| 45 | + <label for="<?php echo esc_attr($id); ?>"><?php echo wp_kses_post($label); ?></label> |
|
| 46 | + <input type="file" class="sr-only getpaid-files-input" id="<?php echo esc_attr($id); ?>" accept="<?php echo esc_attr(implode(', ', $types)); ?>" data-extensions="<?php echo esc_attr(wp_json_encode($_types)); ?>" <?php echo $max_file_num == 1 ? '' : 'multiple="multiple"'; ?>> |
|
| 47 | 47 | |
| 48 | - <label for="<?php echo esc_attr( $id ); ?>" class="getpaid-file-upload-element d-flex w-100 flex-column align-items-center justify-content-center p-2 mb-2"> |
|
| 48 | + <label for="<?php echo esc_attr($id); ?>" class="getpaid-file-upload-element d-flex w-100 flex-column align-items-center justify-content-center p-2 mb-2"> |
|
| 49 | 49 | <div class="h5 text-dark"> |
| 50 | - <?php echo esc_html( _n( 'Drag your file to this area or click to upload', 'Drag files to this area or click to upload', $max_file_num, 'invoicing' ) ); ?> |
|
| 50 | + <?php echo esc_html(_n('Drag your file to this area or click to upload', 'Drag files to this area or click to upload', $max_file_num, 'invoicing')); ?> |
|
| 51 | 51 | </div> |
| 52 | - <?php if ( ! empty( $description ) ) : ?> |
|
| 53 | - <small class="form-text text-muted"><?php echo wp_kses_post( $description ); ?></small> |
|
| 52 | + <?php if (!empty($description)) : ?> |
|
| 53 | + <small class="form-text text-muted"><?php echo wp_kses_post($description); ?></small> |
|
| 54 | 54 | <?php endif; ?> |
| 55 | 55 | </label> |
| 56 | 56 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | <div class="form-row mb-3 d-none getpaid-progress-template"> |
| 60 | 60 | |
| 61 | 61 | <div class="overflow-hidden text-nowrap col-7 col-sm-4"> |
| 62 | - <a href="" class="close float-none" title="<?php esc_attr_e( 'Remove File', 'invoicing' ); ?>">×<span class="sr-only"><?php esc_html_e( 'Close', 'invoicing' ); ?></span></a> |
|
| 62 | + <a href="" class="close float-none" title="<?php esc_attr_e('Remove File', 'invoicing'); ?>">×<span class="sr-only"><?php esc_html_e('Close', 'invoicing'); ?></span></a> |
|
| 63 | 63 | <i class="fa fa-file" aria-hidden="true"></i> <span class="getpaid-progress-file-name"></span> |
| 64 | 64 | </div> |
| 65 | 65 | |
@@ -7,44 +7,44 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -if ( empty( $form->get_items() ) ) { |
|
| 12 | +if (empty($form->get_items())) { |
|
| 13 | 13 | return; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -if ( ! empty( $GLOBALS['getpaid_force_checkbox'] ) ) { |
|
| 16 | +if (!empty($GLOBALS['getpaid_force_checkbox'])) { |
|
| 17 | 17 | $items_type = 'checkbox'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -if ( empty( $items_type ) ) { |
|
| 20 | +if (empty($items_type)) { |
|
| 21 | 21 | $items_type = 'total'; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -do_action( 'getpaid_before_payment_form_items', $form ); |
|
| 24 | +do_action('getpaid_before_payment_form_items', $form); |
|
| 25 | 25 | |
| 26 | -switch ( $items_type ) { |
|
| 26 | +switch ($items_type) { |
|
| 27 | 27 | case 'radio': |
| 28 | - wpinv_get_template( 'payment-forms/variations/radio.php', compact( 'form', 'items_type' ) ); |
|
| 28 | + wpinv_get_template('payment-forms/variations/radio.php', compact('form', 'items_type')); |
|
| 29 | 29 | break; |
| 30 | 30 | case 'checkbox': |
| 31 | - wpinv_get_template( 'payment-forms/variations/checkbox.php', compact( 'form', 'items_type' ) ); |
|
| 31 | + wpinv_get_template('payment-forms/variations/checkbox.php', compact('form', 'items_type')); |
|
| 32 | 32 | break; |
| 33 | 33 | case 'select': |
| 34 | - wpinv_get_template( 'payment-forms/variations/select.php', compact( 'form', 'items_type' ) ); |
|
| 34 | + wpinv_get_template('payment-forms/variations/select.php', compact('form', 'items_type')); |
|
| 35 | 35 | break; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -do_action( 'getpaid_before_payment_form_cart', $form ); |
|
| 38 | +do_action('getpaid_before_payment_form_cart', $form); |
|
| 39 | 39 | |
| 40 | 40 | // Display the cart totals. |
| 41 | -if ( ! empty( $hide_cart ) ) { |
|
| 41 | +if (!empty($hide_cart)) { |
|
| 42 | 42 | echo '<div class="d-none">'; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Display the cart totals. |
| 46 | -wpinv_get_template( 'payment-forms/cart.php', compact( 'form', 'items_type' ) ); |
|
| 46 | +wpinv_get_template('payment-forms/cart.php', compact('form', 'items_type')); |
|
| 47 | 47 | |
| 48 | -if ( ! empty( $hide_cart ) ) { |
|
| 48 | +if (!empty($hide_cart)) { |
|
| 49 | 49 | echo '</div>'; |
| 50 | 50 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | 46 | foreach ( $form->get_items() as $item ) { |
| 47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
| 47 | + wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the cart totals. |
@@ -7,34 +7,34 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Cart table columns. |
| 13 | 13 | $columns = array( |
| 14 | - 'name' => __( 'Item', 'invoicing' ), |
|
| 15 | - 'price' => __( 'Price', 'invoicing' ), |
|
| 16 | - 'quantity' => __( 'Qty', 'invoicing' ), |
|
| 17 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
| 14 | + 'name' => __('Item', 'invoicing'), |
|
| 15 | + 'price' => __('Price', 'invoicing'), |
|
| 16 | + 'quantity' => __('Qty', 'invoicing'), |
|
| 17 | + 'subtotal' => __('Subtotal', 'invoicing'), |
|
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | -if ( ! empty( $form->invoice ) ) { |
|
| 21 | - $columns = getpaid_invoice_item_columns( $form->invoice ); |
|
| 20 | +if (!empty($form->invoice)) { |
|
| 21 | + $columns = getpaid_invoice_item_columns($form->invoice); |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -if ( isset( $columns['tax_rate'] ) ) { |
|
| 25 | - unset( $columns['tax_rate'] ); |
|
| 24 | +if (isset($columns['tax_rate'])) { |
|
| 25 | + unset($columns['tax_rate']); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form ); |
|
| 28 | +$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form); |
|
| 29 | 29 | |
| 30 | 30 | ?> |
| 31 | 31 | <div class="getpaid-payment-form-items-cart border form-group"> |
| 32 | 32 | |
| 33 | 33 | <div class="getpaid-payment-form-items-cart-header font-weight-bold bg-light border-bottom py-2 px-3"> |
| 34 | 34 | <div class="form-row"> |
| 35 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 36 | - <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo ( in_array( $key, array( 'subtotal', 'quantity', 'tax_rate' ) ) ) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>"> |
|
| 37 | - <span><?php echo esc_html( $label ); ?></span> |
|
| 35 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 36 | + <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo (in_array($key, array('subtotal', 'quantity', 'tax_rate'))) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>"> |
|
| 37 | + <span><?php echo esc_html($label); ?></span> |
|
| 38 | 38 | </div> |
| 39 | 39 | <?php endforeach; ?> |
| 40 | 40 | </div> |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | - foreach ( $form->get_items() as $item ) { |
|
| 47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
| 46 | + foreach ($form->get_items() as $item) { |
|
| 47 | + wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the cart totals. |
| 51 | - wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
| 51 | + wpinv_get_template('payment-forms/cart-totals.php', compact('form')); |
|
| 52 | 52 | |
| 53 | 53 | ?> |
| 54 | 54 | </div> |
| 55 | 55 | |
| 56 | 56 | <?php |
| 57 | 57 | |
| 58 | -do_action( 'getpaid_after_payment_form_cart', $form ); |
|
| 58 | +do_action('getpaid_after_payment_form_cart', $form); |
|
@@ -44,12 +44,12 @@ |
||
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | 46 | foreach ( $invoice->get_items() as $item ) { |
| 47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 47 | + wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the fee totals. |
| 51 | 51 | foreach ( $invoice->get_fees() as $fee ) { |
| 52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 52 | + wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | ?> |
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | -$column_count = count( $columns ); |
|
| 13 | +$column_count = count($columns); |
|
| 14 | 14 | ?> |
| 15 | 15 | |
| 16 | -<?php do_action( 'wpinv_before_email_items', $invoice ); ?> |
|
| 16 | +<?php do_action('wpinv_before_email_items', $invoice); ?> |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | <div id="wpinv-email-items"> |
| 20 | 20 | |
| 21 | 21 | <h3 class="invoice-items-title"> |
| 22 | - <?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?> |
|
| 22 | + <?php echo sprintf(esc_html__('%s Items', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?> |
|
| 23 | 23 | </h3> |
| 24 | 24 | |
| 25 | 25 | <table class="table table-bordered table-hover"> |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | <tr class="wpinv_cart_header_row"> |
| 30 | 30 | |
| 31 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 32 | - <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr( $key ); ?>"> |
|
| 33 | - <?php echo esc_html( $label ); ?> |
|
| 31 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 32 | + <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo esc_attr($key); ?>"> |
|
| 33 | + <?php echo esc_html($label); ?> |
|
| 34 | 34 | </th> |
| 35 | 35 | <?php endforeach; ?> |
| 36 | 36 | |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | - foreach ( $invoice->get_items() as $item ) { |
|
| 47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 46 | + foreach ($invoice->get_items() as $item) { |
|
| 47 | + wpinv_get_template('emails/invoice-item.php', compact('invoice', 'item', 'columns')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the fee totals. |
| 51 | - foreach ( $invoice->get_fees() as $fee ) { |
|
| 52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 51 | + foreach ($invoice->get_fees() as $fee) { |
|
| 52 | + wpinv_get_template('emails/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | ?> |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | </tbody> |
| 58 | 58 | |
| 59 | 59 | <tfoot> |
| 60 | - <?php wpinv_get_template( 'emails/invoice-totals.php', compact( 'invoice', 'column_count' ) ); ?> |
|
| 60 | + <?php wpinv_get_template('emails/invoice-totals.php', compact('invoice', 'column_count')); ?> |
|
| 61 | 61 | </tfoot> |
| 62 | 62 | |
| 63 | 63 | </table> |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | <a href="<?php echo esc_url( add_query_arg( 'user_id', $invoice->get_user_id(), self_admin_url( 'user-edit.php' ) ) ); ?>"><?php echo esc_html( $invoice->get_user_full_name() ); ?></a> |
| 21 | 21 | <?php |
| 22 | 22 | } else { |
| 23 | - echo esc_html( $invoice->get_user_full_name() ); } |
|
| 23 | + echo esc_html( $invoice->get_user_full_name() ); } |
|
| 24 | 24 | ?> |
| 25 | 25 | </td> |
| 26 | 26 | </tr> |
@@ -1,51 +1,51 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // don't load directly |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 4 | - die( '-1' ); |
|
| 3 | +if (!defined('ABSPATH')) { |
|
| 4 | + die('-1'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -do_action( 'wpinv_email_before_billing_details', $invoice ); ?> |
|
| 7 | +do_action('wpinv_email_before_billing_details', $invoice); ?> |
|
| 8 | 8 | <div id="wpinv-email-billing"> |
| 9 | - <h3 class="wpinv-address-t"><?php echo esc_html( apply_filters( 'wpinv_email_billing_title', __( 'Billing Details', 'invoicing' ) ) ); ?></h3> |
|
| 9 | + <h3 class="wpinv-address-t"><?php echo esc_html(apply_filters('wpinv_email_billing_title', __('Billing Details', 'invoicing'))); ?></h3> |
|
| 10 | 10 | |
| 11 | 11 | <table class="table table-bordered table-sm wpi-billing-details"> |
| 12 | 12 | <tbody> |
| 13 | - <?php do_action( 'wpinv_email_billing_fields_first', $invoice ); ?> |
|
| 13 | + <?php do_action('wpinv_email_billing_fields_first', $invoice); ?> |
|
| 14 | 14 | <tr class="wpi-receipt-name"> |
| 15 | - <th class="text-left"><?php esc_html_e( 'Name', 'invoicing' ); ?></th> |
|
| 15 | + <th class="text-left"><?php esc_html_e('Name', 'invoicing'); ?></th> |
|
| 16 | 16 | <td> |
| 17 | 17 | <?php |
| 18 | - if ( $sent_to_admin && $invoice->get_user_id() ) { |
|
| 18 | + if ($sent_to_admin && $invoice->get_user_id()) { |
|
| 19 | 19 | ?> |
| 20 | -<a href="<?php echo esc_url( add_query_arg( 'user_id', $invoice->get_user_id(), self_admin_url( 'user-edit.php' ) ) ); ?>"><?php echo esc_html( $invoice->get_user_full_name() ); ?></a> |
|
| 20 | +<a href="<?php echo esc_url(add_query_arg('user_id', $invoice->get_user_id(), self_admin_url('user-edit.php'))); ?>"><?php echo esc_html($invoice->get_user_full_name()); ?></a> |
|
| 21 | 21 | <?php |
| 22 | 22 | } else { |
| 23 | - echo esc_html( $invoice->get_user_full_name() ); } |
|
| 23 | + echo esc_html($invoice->get_user_full_name()); } |
|
| 24 | 24 | ?> |
| 25 | 25 | </td> |
| 26 | 26 | </tr> |
| 27 | 27 | <tr class="wpi-receipt-email"> |
| 28 | - <th class="text-left"><?php esc_html_e( 'Email', 'invoicing' ); ?></th> |
|
| 29 | - <td><?php echo esc_html( sanitize_email( $invoice->get_email() ) ); ?></td> |
|
| 28 | + <th class="text-left"><?php esc_html_e('Email', 'invoicing'); ?></th> |
|
| 29 | + <td><?php echo esc_html(sanitize_email($invoice->get_email())); ?></td> |
|
| 30 | 30 | </tr> |
| 31 | - <?php if ( $invoice->get_company() ) { ?> |
|
| 31 | + <?php if ($invoice->get_company()) { ?> |
|
| 32 | 32 | <tr class="wpi-receipt-company"> |
| 33 | - <th class="text-left"><?php esc_html_e( 'Company', 'invoicing' ); ?></th> |
|
| 34 | - <td><?php echo esc_html( $invoice->get_company() ); ?></td> |
|
| 33 | + <th class="text-left"><?php esc_html_e('Company', 'invoicing'); ?></th> |
|
| 34 | + <td><?php echo esc_html($invoice->get_company()); ?></td> |
|
| 35 | 35 | </tr> |
| 36 | 36 | <?php } ?> |
| 37 | 37 | <tr class="wpi-receipt-address"> |
| 38 | - <th class="text-left"><?php esc_html_e( 'Address', 'invoicing' ); ?></th> |
|
| 39 | - <td><?php echo wp_kses_post( wpinv_get_invoice_address_markup( $invoice->get_user_info() ) ); ?></td> |
|
| 38 | + <th class="text-left"><?php esc_html_e('Address', 'invoicing'); ?></th> |
|
| 39 | + <td><?php echo wp_kses_post(wpinv_get_invoice_address_markup($invoice->get_user_info())); ?></td> |
|
| 40 | 40 | </tr> |
| 41 | - <?php if ( $invoice->get_phone() ) { ?> |
|
| 41 | + <?php if ($invoice->get_phone()) { ?> |
|
| 42 | 42 | <tr class="wpi-receipt-phone"> |
| 43 | - <th class="text-left"><?php esc_html_e( 'Phone', 'invoicing' ); ?></th> |
|
| 44 | - <td><?php echo esc_html( $invoice->get_phone() ); ?></td> |
|
| 43 | + <th class="text-left"><?php esc_html_e('Phone', 'invoicing'); ?></th> |
|
| 44 | + <td><?php echo esc_html($invoice->get_phone()); ?></td> |
|
| 45 | 45 | </tr> |
| 46 | 46 | <?php } ?> |
| 47 | - <?php do_action( 'wpinv_email_billing_fields_last', $invoice ); ?> |
|
| 47 | + <?php do_action('wpinv_email_billing_fields_last', $invoice); ?> |
|
| 48 | 48 | </tbody> |
| 49 | 49 | </table> |
| 50 | 50 | </div> |
| 51 | -<?php do_action( 'wpinv_email_after_billing_details', $invoice ); ?> |
|
| 51 | +<?php do_action('wpinv_email_after_billing_details', $invoice); ?> |
|
@@ -15,321 +15,321 @@ |
||
| 15 | 15 | class GetPaid_Post_Types { |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * Hook in methods. |
|
| 19 | - */ |
|
| 20 | - public function __construct() { |
|
| 21 | - add_action( 'init', array( __CLASS__, 'register_post_types' ), 1 ); |
|
| 22 | - add_action( 'init', array( __CLASS__, 'register_post_status' ), 4 ); |
|
| 23 | - add_action( 'getpaid_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) ); |
|
| 24 | - add_action( 'getpaid_after_register_post_types', array( __CLASS__, 'maybe_flush_rewrite_rules' ) ); |
|
| 25 | - } |
|
| 18 | + * Hook in methods. |
|
| 19 | + */ |
|
| 20 | + public function __construct() { |
|
| 21 | + add_action( 'init', array( __CLASS__, 'register_post_types' ), 1 ); |
|
| 22 | + add_action( 'init', array( __CLASS__, 'register_post_status' ), 4 ); |
|
| 23 | + add_action( 'getpaid_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) ); |
|
| 24 | + add_action( 'getpaid_after_register_post_types', array( __CLASS__, 'maybe_flush_rewrite_rules' ) ); |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Register core post types. |
|
| 29 | - */ |
|
| 30 | - public static function register_post_types() { |
|
| 27 | + /** |
|
| 28 | + * Register core post types. |
|
| 29 | + */ |
|
| 30 | + public static function register_post_types() { |
|
| 31 | 31 | |
| 32 | - if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) { |
|
| 33 | - return; |
|
| 34 | - } |
|
| 32 | + if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) { |
|
| 33 | + return; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - $capabilities = wpinv_current_user_can_manage_invoicing(); |
|
| 36 | + $capabilities = wpinv_current_user_can_manage_invoicing(); |
|
| 37 | 37 | |
| 38 | - // Fires before registering post types. |
|
| 39 | - do_action( 'getpaid_register_post_types' ); |
|
| 38 | + // Fires before registering post types. |
|
| 39 | + do_action( 'getpaid_register_post_types' ); |
|
| 40 | 40 | |
| 41 | - // Register item post type. |
|
| 42 | - register_post_type( |
|
| 43 | - 'wpi_item', |
|
| 44 | - apply_filters( |
|
| 45 | - 'wpinv_register_post_type_invoice_item', |
|
| 46 | - array( |
|
| 47 | - 'labels' => array( |
|
| 48 | - 'name' => _x( 'Items', 'post type general name', 'invoicing' ), |
|
| 49 | - 'singular_name' => _x( 'Item', 'post type singular name', 'invoicing' ), |
|
| 50 | - 'menu_name' => _x( 'Items', 'admin menu', 'invoicing' ), |
|
| 51 | - 'name_admin_bar' => _x( 'Item', 'add new on admin bar', 'invoicing' ), |
|
| 52 | - 'add_new' => _x( 'Add New', 'Item', 'invoicing' ), |
|
| 53 | - 'add_new_item' => __( 'Add New Item', 'invoicing' ), |
|
| 54 | - 'new_item' => __( 'New Item', 'invoicing' ), |
|
| 55 | - 'edit_item' => __( 'Edit Item', 'invoicing' ), |
|
| 56 | - 'view_item' => __( 'View Item', 'invoicing' ), |
|
| 57 | - 'all_items' => __( 'Items', 'invoicing' ), |
|
| 58 | - 'search_items' => __( 'Search items', 'invoicing' ), |
|
| 59 | - 'parent_item_colon' => __( 'Parent item:', 'invoicing' ), |
|
| 60 | - 'not_found' => __( 'No items found.', 'invoicing' ), |
|
| 61 | - 'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' ), |
|
| 62 | - ), |
|
| 63 | - 'description' => __( 'This is where you can add new invoice items.', 'invoicing' ), |
|
| 64 | - 'public' => false, |
|
| 65 | - 'has_archive' => false, |
|
| 66 | - '_builtin' => false, |
|
| 67 | - 'show_ui' => true, |
|
| 68 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 69 | - 'show_in_nav_menus' => false, |
|
| 70 | - 'supports' => array( 'title', 'excerpt', 'thumbnail' ), |
|
| 71 | - 'rewrite' => false, |
|
| 72 | - 'query_var' => false, |
|
| 73 | - 'map_meta_cap' => true, |
|
| 74 | - 'show_in_admin_bar' => true, |
|
| 75 | - 'can_export' => true, |
|
| 76 | - ) |
|
| 77 | - ) |
|
| 78 | - ); |
|
| 41 | + // Register item post type. |
|
| 42 | + register_post_type( |
|
| 43 | + 'wpi_item', |
|
| 44 | + apply_filters( |
|
| 45 | + 'wpinv_register_post_type_invoice_item', |
|
| 46 | + array( |
|
| 47 | + 'labels' => array( |
|
| 48 | + 'name' => _x( 'Items', 'post type general name', 'invoicing' ), |
|
| 49 | + 'singular_name' => _x( 'Item', 'post type singular name', 'invoicing' ), |
|
| 50 | + 'menu_name' => _x( 'Items', 'admin menu', 'invoicing' ), |
|
| 51 | + 'name_admin_bar' => _x( 'Item', 'add new on admin bar', 'invoicing' ), |
|
| 52 | + 'add_new' => _x( 'Add New', 'Item', 'invoicing' ), |
|
| 53 | + 'add_new_item' => __( 'Add New Item', 'invoicing' ), |
|
| 54 | + 'new_item' => __( 'New Item', 'invoicing' ), |
|
| 55 | + 'edit_item' => __( 'Edit Item', 'invoicing' ), |
|
| 56 | + 'view_item' => __( 'View Item', 'invoicing' ), |
|
| 57 | + 'all_items' => __( 'Items', 'invoicing' ), |
|
| 58 | + 'search_items' => __( 'Search items', 'invoicing' ), |
|
| 59 | + 'parent_item_colon' => __( 'Parent item:', 'invoicing' ), |
|
| 60 | + 'not_found' => __( 'No items found.', 'invoicing' ), |
|
| 61 | + 'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' ), |
|
| 62 | + ), |
|
| 63 | + 'description' => __( 'This is where you can add new invoice items.', 'invoicing' ), |
|
| 64 | + 'public' => false, |
|
| 65 | + 'has_archive' => false, |
|
| 66 | + '_builtin' => false, |
|
| 67 | + 'show_ui' => true, |
|
| 68 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 69 | + 'show_in_nav_menus' => false, |
|
| 70 | + 'supports' => array( 'title', 'excerpt', 'thumbnail' ), |
|
| 71 | + 'rewrite' => false, |
|
| 72 | + 'query_var' => false, |
|
| 73 | + 'map_meta_cap' => true, |
|
| 74 | + 'show_in_admin_bar' => true, |
|
| 75 | + 'can_export' => true, |
|
| 76 | + ) |
|
| 77 | + ) |
|
| 78 | + ); |
|
| 79 | 79 | |
| 80 | - // Register payment form post type. |
|
| 81 | - register_post_type( |
|
| 82 | - 'wpi_payment_form', |
|
| 83 | - apply_filters( |
|
| 84 | - 'wpinv_register_post_type_payment_form', |
|
| 85 | - array( |
|
| 86 | - 'labels' => array( |
|
| 87 | - 'name' => _x( 'Payment Forms', 'post type general name', 'invoicing' ), |
|
| 88 | - 'singular_name' => _x( 'Payment Form', 'post type singular name', 'invoicing' ), |
|
| 89 | - 'menu_name' => _x( 'Payment Forms', 'admin menu', 'invoicing' ), |
|
| 90 | - 'name_admin_bar' => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ), |
|
| 91 | - 'add_new' => _x( 'Add New', 'Payment Form', 'invoicing' ), |
|
| 92 | - 'add_new_item' => __( 'Add New Payment Form', 'invoicing' ), |
|
| 93 | - 'new_item' => __( 'New Payment Form', 'invoicing' ), |
|
| 94 | - 'edit_item' => __( 'Edit Payment Form', 'invoicing' ), |
|
| 95 | - 'view_item' => __( 'View Payment Form', 'invoicing' ), |
|
| 96 | - 'all_items' => __( 'Payment Forms', 'invoicing' ), |
|
| 97 | - 'search_items' => __( 'Search Payment Forms', 'invoicing' ), |
|
| 98 | - 'parent_item_colon' => __( 'Parent Payment Forms:', 'invoicing' ), |
|
| 99 | - 'not_found' => __( 'No payment forms found.', 'invoicing' ), |
|
| 100 | - 'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' ), |
|
| 101 | - ), |
|
| 102 | - 'description' => __( 'Add new payment forms.', 'invoicing' ), |
|
| 103 | - 'public' => false, |
|
| 104 | - 'show_ui' => true, |
|
| 105 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 106 | - 'show_in_nav_menus' => false, |
|
| 107 | - 'query_var' => false, |
|
| 108 | - 'rewrite' => true, |
|
| 109 | - 'map_meta_cap' => true, |
|
| 110 | - 'has_archive' => false, |
|
| 111 | - 'hierarchical' => false, |
|
| 112 | - 'menu_position' => null, |
|
| 113 | - 'supports' => array( 'title' ), |
|
| 114 | - 'menu_icon' => 'dashicons-media-form', |
|
| 115 | - ) |
|
| 116 | - ) |
|
| 117 | - ); |
|
| 80 | + // Register payment form post type. |
|
| 81 | + register_post_type( |
|
| 82 | + 'wpi_payment_form', |
|
| 83 | + apply_filters( |
|
| 84 | + 'wpinv_register_post_type_payment_form', |
|
| 85 | + array( |
|
| 86 | + 'labels' => array( |
|
| 87 | + 'name' => _x( 'Payment Forms', 'post type general name', 'invoicing' ), |
|
| 88 | + 'singular_name' => _x( 'Payment Form', 'post type singular name', 'invoicing' ), |
|
| 89 | + 'menu_name' => _x( 'Payment Forms', 'admin menu', 'invoicing' ), |
|
| 90 | + 'name_admin_bar' => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ), |
|
| 91 | + 'add_new' => _x( 'Add New', 'Payment Form', 'invoicing' ), |
|
| 92 | + 'add_new_item' => __( 'Add New Payment Form', 'invoicing' ), |
|
| 93 | + 'new_item' => __( 'New Payment Form', 'invoicing' ), |
|
| 94 | + 'edit_item' => __( 'Edit Payment Form', 'invoicing' ), |
|
| 95 | + 'view_item' => __( 'View Payment Form', 'invoicing' ), |
|
| 96 | + 'all_items' => __( 'Payment Forms', 'invoicing' ), |
|
| 97 | + 'search_items' => __( 'Search Payment Forms', 'invoicing' ), |
|
| 98 | + 'parent_item_colon' => __( 'Parent Payment Forms:', 'invoicing' ), |
|
| 99 | + 'not_found' => __( 'No payment forms found.', 'invoicing' ), |
|
| 100 | + 'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' ), |
|
| 101 | + ), |
|
| 102 | + 'description' => __( 'Add new payment forms.', 'invoicing' ), |
|
| 103 | + 'public' => false, |
|
| 104 | + 'show_ui' => true, |
|
| 105 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 106 | + 'show_in_nav_menus' => false, |
|
| 107 | + 'query_var' => false, |
|
| 108 | + 'rewrite' => true, |
|
| 109 | + 'map_meta_cap' => true, |
|
| 110 | + 'has_archive' => false, |
|
| 111 | + 'hierarchical' => false, |
|
| 112 | + 'menu_position' => null, |
|
| 113 | + 'supports' => array( 'title' ), |
|
| 114 | + 'menu_icon' => 'dashicons-media-form', |
|
| 115 | + ) |
|
| 116 | + ) |
|
| 117 | + ); |
|
| 118 | 118 | |
| 119 | - // Register invoice post type. |
|
| 120 | - register_post_type( |
|
| 121 | - 'wpi_invoice', |
|
| 122 | - apply_filters( |
|
| 123 | - 'wpinv_register_post_type_invoice', |
|
| 124 | - array( |
|
| 125 | - 'labels' => array( |
|
| 126 | - 'name' => __( 'Invoices', 'invoicing' ), |
|
| 127 | - 'singular_name' => __( 'Invoice', 'invoicing' ), |
|
| 128 | - 'all_items' => __( 'Invoices', 'invoicing' ), |
|
| 129 | - 'menu_name' => _x( 'Invoices', 'Admin menu name', 'invoicing' ), |
|
| 130 | - 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 131 | - 'add_new_item' => __( 'Add new invoice', 'invoicing' ), |
|
| 132 | - 'edit' => __( 'Edit', 'invoicing' ), |
|
| 133 | - 'edit_item' => __( 'Edit invoice', 'invoicing' ), |
|
| 134 | - 'new_item' => __( 'New invoice', 'invoicing' ), |
|
| 135 | - 'view_item' => __( 'View invoice', 'invoicing' ), |
|
| 136 | - 'view_items' => __( 'View Invoices', 'invoicing' ), |
|
| 137 | - 'search_items' => __( 'Search invoices', 'invoicing' ), |
|
| 138 | - 'not_found' => __( 'No invoices found', 'invoicing' ), |
|
| 139 | - 'not_found_in_trash' => __( 'No invoices found in trash', 'invoicing' ), |
|
| 140 | - 'parent' => __( 'Parent invoice', 'invoicing' ), |
|
| 141 | - 'featured_image' => __( 'Invoice image', 'invoicing' ), |
|
| 142 | - 'set_featured_image' => __( 'Set invoice image', 'invoicing' ), |
|
| 143 | - 'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ), |
|
| 144 | - 'use_featured_image' => __( 'Use as invoice image', 'invoicing' ), |
|
| 145 | - 'insert_into_item' => __( 'Insert into invoice', 'invoicing' ), |
|
| 146 | - 'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ), |
|
| 147 | - 'filter_items_list' => __( 'Filter invoices', 'invoicing' ), |
|
| 148 | - 'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ), |
|
| 149 | - 'items_list' => __( 'Invoices list', 'invoicing' ), |
|
| 150 | - ), |
|
| 151 | - 'description' => __( 'This is where invoices are stored.', 'invoicing' ), |
|
| 152 | - 'public' => true, |
|
| 153 | - 'has_archive' => false, |
|
| 154 | - 'publicly_queryable' => true, |
|
| 155 | - 'exclude_from_search' => true, |
|
| 156 | - 'show_ui' => true, |
|
| 157 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 158 | - 'show_in_nav_menus' => false, |
|
| 159 | - 'supports' => array( 'title', 'author', 'excerpt' ), |
|
| 160 | - 'rewrite' => array( |
|
| 161 | - 'slug' => 'invoice', |
|
| 162 | - 'with_front' => false, |
|
| 163 | - ), |
|
| 164 | - 'query_var' => false, |
|
| 165 | - 'map_meta_cap' => true, |
|
| 166 | - 'show_in_admin_bar' => true, |
|
| 167 | - 'can_export' => true, |
|
| 168 | - 'hierarchical' => false, |
|
| 169 | - 'menu_position' => null, |
|
| 170 | - 'menu_icon' => 'dashicons-media-spreadsheet', |
|
| 171 | - ) |
|
| 172 | - ) |
|
| 173 | - ); |
|
| 119 | + // Register invoice post type. |
|
| 120 | + register_post_type( |
|
| 121 | + 'wpi_invoice', |
|
| 122 | + apply_filters( |
|
| 123 | + 'wpinv_register_post_type_invoice', |
|
| 124 | + array( |
|
| 125 | + 'labels' => array( |
|
| 126 | + 'name' => __( 'Invoices', 'invoicing' ), |
|
| 127 | + 'singular_name' => __( 'Invoice', 'invoicing' ), |
|
| 128 | + 'all_items' => __( 'Invoices', 'invoicing' ), |
|
| 129 | + 'menu_name' => _x( 'Invoices', 'Admin menu name', 'invoicing' ), |
|
| 130 | + 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 131 | + 'add_new_item' => __( 'Add new invoice', 'invoicing' ), |
|
| 132 | + 'edit' => __( 'Edit', 'invoicing' ), |
|
| 133 | + 'edit_item' => __( 'Edit invoice', 'invoicing' ), |
|
| 134 | + 'new_item' => __( 'New invoice', 'invoicing' ), |
|
| 135 | + 'view_item' => __( 'View invoice', 'invoicing' ), |
|
| 136 | + 'view_items' => __( 'View Invoices', 'invoicing' ), |
|
| 137 | + 'search_items' => __( 'Search invoices', 'invoicing' ), |
|
| 138 | + 'not_found' => __( 'No invoices found', 'invoicing' ), |
|
| 139 | + 'not_found_in_trash' => __( 'No invoices found in trash', 'invoicing' ), |
|
| 140 | + 'parent' => __( 'Parent invoice', 'invoicing' ), |
|
| 141 | + 'featured_image' => __( 'Invoice image', 'invoicing' ), |
|
| 142 | + 'set_featured_image' => __( 'Set invoice image', 'invoicing' ), |
|
| 143 | + 'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ), |
|
| 144 | + 'use_featured_image' => __( 'Use as invoice image', 'invoicing' ), |
|
| 145 | + 'insert_into_item' => __( 'Insert into invoice', 'invoicing' ), |
|
| 146 | + 'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ), |
|
| 147 | + 'filter_items_list' => __( 'Filter invoices', 'invoicing' ), |
|
| 148 | + 'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ), |
|
| 149 | + 'items_list' => __( 'Invoices list', 'invoicing' ), |
|
| 150 | + ), |
|
| 151 | + 'description' => __( 'This is where invoices are stored.', 'invoicing' ), |
|
| 152 | + 'public' => true, |
|
| 153 | + 'has_archive' => false, |
|
| 154 | + 'publicly_queryable' => true, |
|
| 155 | + 'exclude_from_search' => true, |
|
| 156 | + 'show_ui' => true, |
|
| 157 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 158 | + 'show_in_nav_menus' => false, |
|
| 159 | + 'supports' => array( 'title', 'author', 'excerpt' ), |
|
| 160 | + 'rewrite' => array( |
|
| 161 | + 'slug' => 'invoice', |
|
| 162 | + 'with_front' => false, |
|
| 163 | + ), |
|
| 164 | + 'query_var' => false, |
|
| 165 | + 'map_meta_cap' => true, |
|
| 166 | + 'show_in_admin_bar' => true, |
|
| 167 | + 'can_export' => true, |
|
| 168 | + 'hierarchical' => false, |
|
| 169 | + 'menu_position' => null, |
|
| 170 | + 'menu_icon' => 'dashicons-media-spreadsheet', |
|
| 171 | + ) |
|
| 172 | + ) |
|
| 173 | + ); |
|
| 174 | 174 | |
| 175 | - // Register discount post type. |
|
| 176 | - register_post_type( |
|
| 177 | - 'wpi_discount', |
|
| 178 | - apply_filters( |
|
| 179 | - 'wpinv_register_post_type_discount', |
|
| 180 | - array( |
|
| 181 | - 'labels' => array( |
|
| 182 | - 'name' => __( 'Discounts', 'invoicing' ), |
|
| 183 | - 'singular_name' => __( 'Discount', 'invoicing' ), |
|
| 184 | - 'all_items' => __( 'Discounts', 'invoicing' ), |
|
| 185 | - 'menu_name' => _x( 'Discounts', 'Admin menu name', 'invoicing' ), |
|
| 186 | - 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 187 | - 'add_new_item' => __( 'Add new discount', 'invoicing' ), |
|
| 188 | - 'edit' => __( 'Edit', 'invoicing' ), |
|
| 189 | - 'edit_item' => __( 'Edit discount', 'invoicing' ), |
|
| 190 | - 'new_item' => __( 'New discount', 'invoicing' ), |
|
| 191 | - 'view_item' => __( 'View discount', 'invoicing' ), |
|
| 192 | - 'view_items' => __( 'View Discounts', 'invoicing' ), |
|
| 193 | - 'search_items' => __( 'Search discounts', 'invoicing' ), |
|
| 194 | - 'not_found' => __( 'No discounts found', 'invoicing' ), |
|
| 195 | - 'not_found_in_trash' => __( 'No discounts found in trash', 'invoicing' ), |
|
| 196 | - 'parent' => __( 'Parent discount', 'invoicing' ), |
|
| 197 | - 'featured_image' => __( 'Discount image', 'invoicing' ), |
|
| 198 | - 'set_featured_image' => __( 'Set discount image', 'invoicing' ), |
|
| 199 | - 'remove_featured_image' => __( 'Remove discount image', 'invoicing' ), |
|
| 200 | - 'use_featured_image' => __( 'Use as discount image', 'invoicing' ), |
|
| 201 | - 'insert_into_item' => __( 'Insert into discount', 'invoicing' ), |
|
| 202 | - 'uploaded_to_this_item' => __( 'Uploaded to this discount', 'invoicing' ), |
|
| 203 | - 'filter_items_list' => __( 'Filter discounts', 'invoicing' ), |
|
| 204 | - 'items_list_navigation' => __( 'Discount navigation', 'invoicing' ), |
|
| 205 | - 'items_list' => __( 'Discounts list', 'invoicing' ), |
|
| 206 | - ), |
|
| 207 | - 'description' => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ), |
|
| 208 | - 'public' => false, |
|
| 209 | - 'can_export' => true, |
|
| 210 | - '_builtin' => false, |
|
| 211 | - 'publicly_queryable' => false, |
|
| 212 | - 'exclude_from_search' => true, |
|
| 213 | - 'show_ui' => true, |
|
| 214 | - 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 215 | - 'query_var' => false, |
|
| 216 | - 'rewrite' => false, |
|
| 217 | - 'map_meta_cap' => true, |
|
| 218 | - 'has_archive' => false, |
|
| 219 | - 'hierarchical' => false, |
|
| 220 | - 'supports' => array( 'title', 'excerpt' ), |
|
| 221 | - 'show_in_nav_menus' => false, |
|
| 222 | - 'show_in_admin_bar' => true, |
|
| 223 | - 'menu_position' => null, |
|
| 224 | - ) |
|
| 225 | - ) |
|
| 226 | - ); |
|
| 175 | + // Register discount post type. |
|
| 176 | + register_post_type( |
|
| 177 | + 'wpi_discount', |
|
| 178 | + apply_filters( |
|
| 179 | + 'wpinv_register_post_type_discount', |
|
| 180 | + array( |
|
| 181 | + 'labels' => array( |
|
| 182 | + 'name' => __( 'Discounts', 'invoicing' ), |
|
| 183 | + 'singular_name' => __( 'Discount', 'invoicing' ), |
|
| 184 | + 'all_items' => __( 'Discounts', 'invoicing' ), |
|
| 185 | + 'menu_name' => _x( 'Discounts', 'Admin menu name', 'invoicing' ), |
|
| 186 | + 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 187 | + 'add_new_item' => __( 'Add new discount', 'invoicing' ), |
|
| 188 | + 'edit' => __( 'Edit', 'invoicing' ), |
|
| 189 | + 'edit_item' => __( 'Edit discount', 'invoicing' ), |
|
| 190 | + 'new_item' => __( 'New discount', 'invoicing' ), |
|
| 191 | + 'view_item' => __( 'View discount', 'invoicing' ), |
|
| 192 | + 'view_items' => __( 'View Discounts', 'invoicing' ), |
|
| 193 | + 'search_items' => __( 'Search discounts', 'invoicing' ), |
|
| 194 | + 'not_found' => __( 'No discounts found', 'invoicing' ), |
|
| 195 | + 'not_found_in_trash' => __( 'No discounts found in trash', 'invoicing' ), |
|
| 196 | + 'parent' => __( 'Parent discount', 'invoicing' ), |
|
| 197 | + 'featured_image' => __( 'Discount image', 'invoicing' ), |
|
| 198 | + 'set_featured_image' => __( 'Set discount image', 'invoicing' ), |
|
| 199 | + 'remove_featured_image' => __( 'Remove discount image', 'invoicing' ), |
|
| 200 | + 'use_featured_image' => __( 'Use as discount image', 'invoicing' ), |
|
| 201 | + 'insert_into_item' => __( 'Insert into discount', 'invoicing' ), |
|
| 202 | + 'uploaded_to_this_item' => __( 'Uploaded to this discount', 'invoicing' ), |
|
| 203 | + 'filter_items_list' => __( 'Filter discounts', 'invoicing' ), |
|
| 204 | + 'items_list_navigation' => __( 'Discount navigation', 'invoicing' ), |
|
| 205 | + 'items_list' => __( 'Discounts list', 'invoicing' ), |
|
| 206 | + ), |
|
| 207 | + 'description' => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ), |
|
| 208 | + 'public' => false, |
|
| 209 | + 'can_export' => true, |
|
| 210 | + '_builtin' => false, |
|
| 211 | + 'publicly_queryable' => false, |
|
| 212 | + 'exclude_from_search' => true, |
|
| 213 | + 'show_ui' => true, |
|
| 214 | + 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
|
| 215 | + 'query_var' => false, |
|
| 216 | + 'rewrite' => false, |
|
| 217 | + 'map_meta_cap' => true, |
|
| 218 | + 'has_archive' => false, |
|
| 219 | + 'hierarchical' => false, |
|
| 220 | + 'supports' => array( 'title', 'excerpt' ), |
|
| 221 | + 'show_in_nav_menus' => false, |
|
| 222 | + 'show_in_admin_bar' => true, |
|
| 223 | + 'menu_position' => null, |
|
| 224 | + ) |
|
| 225 | + ) |
|
| 226 | + ); |
|
| 227 | 227 | |
| 228 | - do_action( 'getpaid_after_register_post_types' ); |
|
| 229 | - } |
|
| 228 | + do_action( 'getpaid_after_register_post_types' ); |
|
| 229 | + } |
|
| 230 | 230 | |
| 231 | - /** |
|
| 232 | - * Register our custom post statuses. |
|
| 233 | - */ |
|
| 234 | - public static function register_post_status() { |
|
| 231 | + /** |
|
| 232 | + * Register our custom post statuses. |
|
| 233 | + */ |
|
| 234 | + public static function register_post_status() { |
|
| 235 | 235 | |
| 236 | - $invoice_statuses = apply_filters( |
|
| 237 | - 'getpaid_register_invoice_post_statuses', |
|
| 238 | - array( |
|
| 236 | + $invoice_statuses = apply_filters( |
|
| 237 | + 'getpaid_register_invoice_post_statuses', |
|
| 238 | + array( |
|
| 239 | 239 | |
| 240 | - 'wpi-pending' => array( |
|
| 241 | - 'label' => _x( 'Pending Payment', 'Invoice status', 'invoicing' ), |
|
| 242 | - 'public' => true, |
|
| 243 | - 'exclude_from_search' => true, |
|
| 244 | - 'show_in_admin_all_list' => true, |
|
| 245 | - 'show_in_admin_status_list' => true, |
|
| 246 | - /* translators: %s: number of invoices */ |
|
| 247 | - 'label_count' => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' ), |
|
| 248 | - ), |
|
| 240 | + 'wpi-pending' => array( |
|
| 241 | + 'label' => _x( 'Pending Payment', 'Invoice status', 'invoicing' ), |
|
| 242 | + 'public' => true, |
|
| 243 | + 'exclude_from_search' => true, |
|
| 244 | + 'show_in_admin_all_list' => true, |
|
| 245 | + 'show_in_admin_status_list' => true, |
|
| 246 | + /* translators: %s: number of invoices */ |
|
| 247 | + 'label_count' => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' ), |
|
| 248 | + ), |
|
| 249 | 249 | |
| 250 | - 'wpi-processing' => array( |
|
| 251 | - 'label' => _x( 'Processing', 'Invoice status', 'invoicing' ), |
|
| 252 | - 'public' => true, |
|
| 253 | - 'exclude_from_search' => true, |
|
| 254 | - 'show_in_admin_all_list' => true, |
|
| 255 | - 'show_in_admin_status_list' => true, |
|
| 256 | - /* translators: %s: number of invoices */ |
|
| 257 | - 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' ), |
|
| 258 | - ), |
|
| 250 | + 'wpi-processing' => array( |
|
| 251 | + 'label' => _x( 'Processing', 'Invoice status', 'invoicing' ), |
|
| 252 | + 'public' => true, |
|
| 253 | + 'exclude_from_search' => true, |
|
| 254 | + 'show_in_admin_all_list' => true, |
|
| 255 | + 'show_in_admin_status_list' => true, |
|
| 256 | + /* translators: %s: number of invoices */ |
|
| 257 | + 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' ), |
|
| 258 | + ), |
|
| 259 | 259 | |
| 260 | - 'wpi-onhold' => array( |
|
| 261 | - 'label' => _x( 'On Hold', 'Invoice status', 'invoicing' ), |
|
| 262 | - 'public' => true, |
|
| 263 | - 'exclude_from_search' => true, |
|
| 264 | - 'show_in_admin_all_list' => true, |
|
| 265 | - 'show_in_admin_status_list' => true, |
|
| 266 | - /* translators: %s: number of invoices */ |
|
| 267 | - 'label_count' => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' ), |
|
| 268 | - ), |
|
| 260 | + 'wpi-onhold' => array( |
|
| 261 | + 'label' => _x( 'On Hold', 'Invoice status', 'invoicing' ), |
|
| 262 | + 'public' => true, |
|
| 263 | + 'exclude_from_search' => true, |
|
| 264 | + 'show_in_admin_all_list' => true, |
|
| 265 | + 'show_in_admin_status_list' => true, |
|
| 266 | + /* translators: %s: number of invoices */ |
|
| 267 | + 'label_count' => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' ), |
|
| 268 | + ), |
|
| 269 | 269 | |
| 270 | - 'wpi-cancelled' => array( |
|
| 271 | - 'label' => _x( 'Cancelled', 'Invoice status', 'invoicing' ), |
|
| 272 | - 'public' => true, |
|
| 273 | - 'exclude_from_search' => true, |
|
| 274 | - 'show_in_admin_all_list' => true, |
|
| 275 | - 'show_in_admin_status_list' => true, |
|
| 276 | - /* translators: %s: number of invoices */ |
|
| 277 | - 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' ), |
|
| 278 | - ), |
|
| 270 | + 'wpi-cancelled' => array( |
|
| 271 | + 'label' => _x( 'Cancelled', 'Invoice status', 'invoicing' ), |
|
| 272 | + 'public' => true, |
|
| 273 | + 'exclude_from_search' => true, |
|
| 274 | + 'show_in_admin_all_list' => true, |
|
| 275 | + 'show_in_admin_status_list' => true, |
|
| 276 | + /* translators: %s: number of invoices */ |
|
| 277 | + 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' ), |
|
| 278 | + ), |
|
| 279 | 279 | |
| 280 | - 'wpi-refunded' => array( |
|
| 281 | - 'label' => _x( 'Refunded', 'Invoice status', 'invoicing' ), |
|
| 282 | - 'public' => true, |
|
| 283 | - 'exclude_from_search' => true, |
|
| 284 | - 'show_in_admin_all_list' => true, |
|
| 285 | - 'show_in_admin_status_list' => true, |
|
| 286 | - /* translators: %s: number of invoices */ |
|
| 287 | - 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' ), |
|
| 288 | - ), |
|
| 280 | + 'wpi-refunded' => array( |
|
| 281 | + 'label' => _x( 'Refunded', 'Invoice status', 'invoicing' ), |
|
| 282 | + 'public' => true, |
|
| 283 | + 'exclude_from_search' => true, |
|
| 284 | + 'show_in_admin_all_list' => true, |
|
| 285 | + 'show_in_admin_status_list' => true, |
|
| 286 | + /* translators: %s: number of invoices */ |
|
| 287 | + 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' ), |
|
| 288 | + ), |
|
| 289 | 289 | |
| 290 | - 'wpi-failed' => array( |
|
| 291 | - 'label' => _x( 'Failed', 'Invoice status', 'invoicing' ), |
|
| 292 | - 'public' => true, |
|
| 293 | - 'exclude_from_search' => true, |
|
| 294 | - 'show_in_admin_all_list' => true, |
|
| 295 | - 'show_in_admin_status_list' => true, |
|
| 296 | - /* translators: %s: number of invoices */ |
|
| 297 | - 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' ), |
|
| 298 | - ), |
|
| 290 | + 'wpi-failed' => array( |
|
| 291 | + 'label' => _x( 'Failed', 'Invoice status', 'invoicing' ), |
|
| 292 | + 'public' => true, |
|
| 293 | + 'exclude_from_search' => true, |
|
| 294 | + 'show_in_admin_all_list' => true, |
|
| 295 | + 'show_in_admin_status_list' => true, |
|
| 296 | + /* translators: %s: number of invoices */ |
|
| 297 | + 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' ), |
|
| 298 | + ), |
|
| 299 | 299 | |
| 300 | - 'wpi-renewal' => array( |
|
| 301 | - 'label' => _x( 'Renewal', 'Invoice status', 'invoicing' ), |
|
| 302 | - 'public' => true, |
|
| 303 | - 'exclude_from_search' => true, |
|
| 304 | - 'show_in_admin_all_list' => true, |
|
| 305 | - 'show_in_admin_status_list' => true, |
|
| 306 | - /* translators: %s: number of invoices */ |
|
| 307 | - 'label_count' => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' ), |
|
| 308 | - ), |
|
| 309 | - ) |
|
| 310 | - ); |
|
| 300 | + 'wpi-renewal' => array( |
|
| 301 | + 'label' => _x( 'Renewal', 'Invoice status', 'invoicing' ), |
|
| 302 | + 'public' => true, |
|
| 303 | + 'exclude_from_search' => true, |
|
| 304 | + 'show_in_admin_all_list' => true, |
|
| 305 | + 'show_in_admin_status_list' => true, |
|
| 306 | + /* translators: %s: number of invoices */ |
|
| 307 | + 'label_count' => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' ), |
|
| 308 | + ), |
|
| 309 | + ) |
|
| 310 | + ); |
|
| 311 | 311 | |
| 312 | - foreach ( $invoice_statuses as $invoice_statuse => $args ) { |
|
| 313 | - register_post_status( $invoice_statuse, $args ); |
|
| 314 | - } |
|
| 315 | - } |
|
| 312 | + foreach ( $invoice_statuses as $invoice_statuse => $args ) { |
|
| 313 | + register_post_status( $invoice_statuse, $args ); |
|
| 314 | + } |
|
| 315 | + } |
|
| 316 | 316 | |
| 317 | - /** |
|
| 318 | - * Flush rewrite rules. |
|
| 319 | - */ |
|
| 320 | - public static function flush_rewrite_rules() { |
|
| 321 | - flush_rewrite_rules(); |
|
| 322 | - } |
|
| 317 | + /** |
|
| 318 | + * Flush rewrite rules. |
|
| 319 | + */ |
|
| 320 | + public static function flush_rewrite_rules() { |
|
| 321 | + flush_rewrite_rules(); |
|
| 322 | + } |
|
| 323 | 323 | |
| 324 | - /** |
|
| 325 | - * Flush rules to prevent 404. |
|
| 326 | - * |
|
| 327 | - */ |
|
| 328 | - public static function maybe_flush_rewrite_rules() { |
|
| 329 | - if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) { |
|
| 330 | - update_option( 'getpaid_flushed_rewrite_rules', '1' ); |
|
| 331 | - self::flush_rewrite_rules(); |
|
| 332 | - } |
|
| 333 | - } |
|
| 324 | + /** |
|
| 325 | + * Flush rules to prevent 404. |
|
| 326 | + * |
|
| 327 | + */ |
|
| 328 | + public static function maybe_flush_rewrite_rules() { |
|
| 329 | + if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) { |
|
| 330 | + update_option( 'getpaid_flushed_rewrite_rules', '1' ); |
|
| 331 | + self::flush_rewrite_rules(); |
|
| 332 | + } |
|
| 333 | + } |
|
| 334 | 334 | |
| 335 | 335 | } |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -defined( 'ABSPATH' ) || exit; |
|
| 9 | +defined('ABSPATH') || exit; |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * Post types Class |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | * Hook in methods. |
| 19 | 19 | */ |
| 20 | 20 | public function __construct() { |
| 21 | - add_action( 'init', array( __CLASS__, 'register_post_types' ), 1 ); |
|
| 22 | - add_action( 'init', array( __CLASS__, 'register_post_status' ), 4 ); |
|
| 23 | - add_action( 'getpaid_flush_rewrite_rules', array( __CLASS__, 'flush_rewrite_rules' ) ); |
|
| 24 | - add_action( 'getpaid_after_register_post_types', array( __CLASS__, 'maybe_flush_rewrite_rules' ) ); |
|
| 21 | + add_action('init', array(__CLASS__, 'register_post_types'), 1); |
|
| 22 | + add_action('init', array(__CLASS__, 'register_post_status'), 4); |
|
| 23 | + add_action('getpaid_flush_rewrite_rules', array(__CLASS__, 'flush_rewrite_rules')); |
|
| 24 | + add_action('getpaid_after_register_post_types', array(__CLASS__, 'maybe_flush_rewrite_rules')); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public static function register_post_types() { |
| 31 | 31 | |
| 32 | - if ( ! is_blog_installed() || post_type_exists( 'wpi_item' ) ) { |
|
| 32 | + if (!is_blog_installed() || post_type_exists('wpi_item')) { |
|
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | $capabilities = wpinv_current_user_can_manage_invoicing(); |
| 37 | 37 | |
| 38 | 38 | // Fires before registering post types. |
| 39 | - do_action( 'getpaid_register_post_types' ); |
|
| 39 | + do_action('getpaid_register_post_types'); |
|
| 40 | 40 | |
| 41 | 41 | // Register item post type. |
| 42 | 42 | register_post_type( |
@@ -45,29 +45,29 @@ discard block |
||
| 45 | 45 | 'wpinv_register_post_type_invoice_item', |
| 46 | 46 | array( |
| 47 | 47 | 'labels' => array( |
| 48 | - 'name' => _x( 'Items', 'post type general name', 'invoicing' ), |
|
| 49 | - 'singular_name' => _x( 'Item', 'post type singular name', 'invoicing' ), |
|
| 50 | - 'menu_name' => _x( 'Items', 'admin menu', 'invoicing' ), |
|
| 51 | - 'name_admin_bar' => _x( 'Item', 'add new on admin bar', 'invoicing' ), |
|
| 52 | - 'add_new' => _x( 'Add New', 'Item', 'invoicing' ), |
|
| 53 | - 'add_new_item' => __( 'Add New Item', 'invoicing' ), |
|
| 54 | - 'new_item' => __( 'New Item', 'invoicing' ), |
|
| 55 | - 'edit_item' => __( 'Edit Item', 'invoicing' ), |
|
| 56 | - 'view_item' => __( 'View Item', 'invoicing' ), |
|
| 57 | - 'all_items' => __( 'Items', 'invoicing' ), |
|
| 58 | - 'search_items' => __( 'Search items', 'invoicing' ), |
|
| 59 | - 'parent_item_colon' => __( 'Parent item:', 'invoicing' ), |
|
| 60 | - 'not_found' => __( 'No items found.', 'invoicing' ), |
|
| 61 | - 'not_found_in_trash' => __( 'No items found in trash.', 'invoicing' ), |
|
| 48 | + 'name' => _x('Items', 'post type general name', 'invoicing'), |
|
| 49 | + 'singular_name' => _x('Item', 'post type singular name', 'invoicing'), |
|
| 50 | + 'menu_name' => _x('Items', 'admin menu', 'invoicing'), |
|
| 51 | + 'name_admin_bar' => _x('Item', 'add new on admin bar', 'invoicing'), |
|
| 52 | + 'add_new' => _x('Add New', 'Item', 'invoicing'), |
|
| 53 | + 'add_new_item' => __('Add New Item', 'invoicing'), |
|
| 54 | + 'new_item' => __('New Item', 'invoicing'), |
|
| 55 | + 'edit_item' => __('Edit Item', 'invoicing'), |
|
| 56 | + 'view_item' => __('View Item', 'invoicing'), |
|
| 57 | + 'all_items' => __('Items', 'invoicing'), |
|
| 58 | + 'search_items' => __('Search items', 'invoicing'), |
|
| 59 | + 'parent_item_colon' => __('Parent item:', 'invoicing'), |
|
| 60 | + 'not_found' => __('No items found.', 'invoicing'), |
|
| 61 | + 'not_found_in_trash' => __('No items found in trash.', 'invoicing'), |
|
| 62 | 62 | ), |
| 63 | - 'description' => __( 'This is where you can add new invoice items.', 'invoicing' ), |
|
| 63 | + 'description' => __('This is where you can add new invoice items.', 'invoicing'), |
|
| 64 | 64 | 'public' => false, |
| 65 | 65 | 'has_archive' => false, |
| 66 | 66 | '_builtin' => false, |
| 67 | 67 | 'show_ui' => true, |
| 68 | 68 | 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
| 69 | 69 | 'show_in_nav_menus' => false, |
| 70 | - 'supports' => array( 'title', 'excerpt', 'thumbnail' ), |
|
| 70 | + 'supports' => array('title', 'excerpt', 'thumbnail'), |
|
| 71 | 71 | 'rewrite' => false, |
| 72 | 72 | 'query_var' => false, |
| 73 | 73 | 'map_meta_cap' => true, |
@@ -84,22 +84,22 @@ discard block |
||
| 84 | 84 | 'wpinv_register_post_type_payment_form', |
| 85 | 85 | array( |
| 86 | 86 | 'labels' => array( |
| 87 | - 'name' => _x( 'Payment Forms', 'post type general name', 'invoicing' ), |
|
| 88 | - 'singular_name' => _x( 'Payment Form', 'post type singular name', 'invoicing' ), |
|
| 89 | - 'menu_name' => _x( 'Payment Forms', 'admin menu', 'invoicing' ), |
|
| 90 | - 'name_admin_bar' => _x( 'Payment Form', 'add new on admin bar', 'invoicing' ), |
|
| 91 | - 'add_new' => _x( 'Add New', 'Payment Form', 'invoicing' ), |
|
| 92 | - 'add_new_item' => __( 'Add New Payment Form', 'invoicing' ), |
|
| 93 | - 'new_item' => __( 'New Payment Form', 'invoicing' ), |
|
| 94 | - 'edit_item' => __( 'Edit Payment Form', 'invoicing' ), |
|
| 95 | - 'view_item' => __( 'View Payment Form', 'invoicing' ), |
|
| 96 | - 'all_items' => __( 'Payment Forms', 'invoicing' ), |
|
| 97 | - 'search_items' => __( 'Search Payment Forms', 'invoicing' ), |
|
| 98 | - 'parent_item_colon' => __( 'Parent Payment Forms:', 'invoicing' ), |
|
| 99 | - 'not_found' => __( 'No payment forms found.', 'invoicing' ), |
|
| 100 | - 'not_found_in_trash' => __( 'No payment forms found in trash.', 'invoicing' ), |
|
| 87 | + 'name' => _x('Payment Forms', 'post type general name', 'invoicing'), |
|
| 88 | + 'singular_name' => _x('Payment Form', 'post type singular name', 'invoicing'), |
|
| 89 | + 'menu_name' => _x('Payment Forms', 'admin menu', 'invoicing'), |
|
| 90 | + 'name_admin_bar' => _x('Payment Form', 'add new on admin bar', 'invoicing'), |
|
| 91 | + 'add_new' => _x('Add New', 'Payment Form', 'invoicing'), |
|
| 92 | + 'add_new_item' => __('Add New Payment Form', 'invoicing'), |
|
| 93 | + 'new_item' => __('New Payment Form', 'invoicing'), |
|
| 94 | + 'edit_item' => __('Edit Payment Form', 'invoicing'), |
|
| 95 | + 'view_item' => __('View Payment Form', 'invoicing'), |
|
| 96 | + 'all_items' => __('Payment Forms', 'invoicing'), |
|
| 97 | + 'search_items' => __('Search Payment Forms', 'invoicing'), |
|
| 98 | + 'parent_item_colon' => __('Parent Payment Forms:', 'invoicing'), |
|
| 99 | + 'not_found' => __('No payment forms found.', 'invoicing'), |
|
| 100 | + 'not_found_in_trash' => __('No payment forms found in trash.', 'invoicing'), |
|
| 101 | 101 | ), |
| 102 | - 'description' => __( 'Add new payment forms.', 'invoicing' ), |
|
| 102 | + 'description' => __('Add new payment forms.', 'invoicing'), |
|
| 103 | 103 | 'public' => false, |
| 104 | 104 | 'show_ui' => true, |
| 105 | 105 | 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | 'has_archive' => false, |
| 111 | 111 | 'hierarchical' => false, |
| 112 | 112 | 'menu_position' => null, |
| 113 | - 'supports' => array( 'title' ), |
|
| 113 | + 'supports' => array('title'), |
|
| 114 | 114 | 'menu_icon' => 'dashicons-media-form', |
| 115 | 115 | ) |
| 116 | 116 | ) |
@@ -123,32 +123,32 @@ discard block |
||
| 123 | 123 | 'wpinv_register_post_type_invoice', |
| 124 | 124 | array( |
| 125 | 125 | 'labels' => array( |
| 126 | - 'name' => __( 'Invoices', 'invoicing' ), |
|
| 127 | - 'singular_name' => __( 'Invoice', 'invoicing' ), |
|
| 128 | - 'all_items' => __( 'Invoices', 'invoicing' ), |
|
| 129 | - 'menu_name' => _x( 'Invoices', 'Admin menu name', 'invoicing' ), |
|
| 130 | - 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 131 | - 'add_new_item' => __( 'Add new invoice', 'invoicing' ), |
|
| 132 | - 'edit' => __( 'Edit', 'invoicing' ), |
|
| 133 | - 'edit_item' => __( 'Edit invoice', 'invoicing' ), |
|
| 134 | - 'new_item' => __( 'New invoice', 'invoicing' ), |
|
| 135 | - 'view_item' => __( 'View invoice', 'invoicing' ), |
|
| 136 | - 'view_items' => __( 'View Invoices', 'invoicing' ), |
|
| 137 | - 'search_items' => __( 'Search invoices', 'invoicing' ), |
|
| 138 | - 'not_found' => __( 'No invoices found', 'invoicing' ), |
|
| 139 | - 'not_found_in_trash' => __( 'No invoices found in trash', 'invoicing' ), |
|
| 140 | - 'parent' => __( 'Parent invoice', 'invoicing' ), |
|
| 141 | - 'featured_image' => __( 'Invoice image', 'invoicing' ), |
|
| 142 | - 'set_featured_image' => __( 'Set invoice image', 'invoicing' ), |
|
| 143 | - 'remove_featured_image' => __( 'Remove invoice image', 'invoicing' ), |
|
| 144 | - 'use_featured_image' => __( 'Use as invoice image', 'invoicing' ), |
|
| 145 | - 'insert_into_item' => __( 'Insert into invoice', 'invoicing' ), |
|
| 146 | - 'uploaded_to_this_item' => __( 'Uploaded to this invoice', 'invoicing' ), |
|
| 147 | - 'filter_items_list' => __( 'Filter invoices', 'invoicing' ), |
|
| 148 | - 'items_list_navigation' => __( 'Invoices navigation', 'invoicing' ), |
|
| 149 | - 'items_list' => __( 'Invoices list', 'invoicing' ), |
|
| 126 | + 'name' => __('Invoices', 'invoicing'), |
|
| 127 | + 'singular_name' => __('Invoice', 'invoicing'), |
|
| 128 | + 'all_items' => __('Invoices', 'invoicing'), |
|
| 129 | + 'menu_name' => _x('Invoices', 'Admin menu name', 'invoicing'), |
|
| 130 | + 'add_new' => __('Add New', 'invoicing'), |
|
| 131 | + 'add_new_item' => __('Add new invoice', 'invoicing'), |
|
| 132 | + 'edit' => __('Edit', 'invoicing'), |
|
| 133 | + 'edit_item' => __('Edit invoice', 'invoicing'), |
|
| 134 | + 'new_item' => __('New invoice', 'invoicing'), |
|
| 135 | + 'view_item' => __('View invoice', 'invoicing'), |
|
| 136 | + 'view_items' => __('View Invoices', 'invoicing'), |
|
| 137 | + 'search_items' => __('Search invoices', 'invoicing'), |
|
| 138 | + 'not_found' => __('No invoices found', 'invoicing'), |
|
| 139 | + 'not_found_in_trash' => __('No invoices found in trash', 'invoicing'), |
|
| 140 | + 'parent' => __('Parent invoice', 'invoicing'), |
|
| 141 | + 'featured_image' => __('Invoice image', 'invoicing'), |
|
| 142 | + 'set_featured_image' => __('Set invoice image', 'invoicing'), |
|
| 143 | + 'remove_featured_image' => __('Remove invoice image', 'invoicing'), |
|
| 144 | + 'use_featured_image' => __('Use as invoice image', 'invoicing'), |
|
| 145 | + 'insert_into_item' => __('Insert into invoice', 'invoicing'), |
|
| 146 | + 'uploaded_to_this_item' => __('Uploaded to this invoice', 'invoicing'), |
|
| 147 | + 'filter_items_list' => __('Filter invoices', 'invoicing'), |
|
| 148 | + 'items_list_navigation' => __('Invoices navigation', 'invoicing'), |
|
| 149 | + 'items_list' => __('Invoices list', 'invoicing'), |
|
| 150 | 150 | ), |
| 151 | - 'description' => __( 'This is where invoices are stored.', 'invoicing' ), |
|
| 151 | + 'description' => __('This is where invoices are stored.', 'invoicing'), |
|
| 152 | 152 | 'public' => true, |
| 153 | 153 | 'has_archive' => false, |
| 154 | 154 | 'publicly_queryable' => true, |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | 'show_ui' => true, |
| 157 | 157 | 'show_in_menu' => wpinv_current_user_can_manage_invoicing() ? 'wpinv' : false, |
| 158 | 158 | 'show_in_nav_menus' => false, |
| 159 | - 'supports' => array( 'title', 'author', 'excerpt' ), |
|
| 159 | + 'supports' => array('title', 'author', 'excerpt'), |
|
| 160 | 160 | 'rewrite' => array( |
| 161 | 161 | 'slug' => 'invoice', |
| 162 | 162 | 'with_front' => false, |
@@ -179,32 +179,32 @@ discard block |
||
| 179 | 179 | 'wpinv_register_post_type_discount', |
| 180 | 180 | array( |
| 181 | 181 | 'labels' => array( |
| 182 | - 'name' => __( 'Discounts', 'invoicing' ), |
|
| 183 | - 'singular_name' => __( 'Discount', 'invoicing' ), |
|
| 184 | - 'all_items' => __( 'Discounts', 'invoicing' ), |
|
| 185 | - 'menu_name' => _x( 'Discounts', 'Admin menu name', 'invoicing' ), |
|
| 186 | - 'add_new' => __( 'Add New', 'invoicing' ), |
|
| 187 | - 'add_new_item' => __( 'Add new discount', 'invoicing' ), |
|
| 188 | - 'edit' => __( 'Edit', 'invoicing' ), |
|
| 189 | - 'edit_item' => __( 'Edit discount', 'invoicing' ), |
|
| 190 | - 'new_item' => __( 'New discount', 'invoicing' ), |
|
| 191 | - 'view_item' => __( 'View discount', 'invoicing' ), |
|
| 192 | - 'view_items' => __( 'View Discounts', 'invoicing' ), |
|
| 193 | - 'search_items' => __( 'Search discounts', 'invoicing' ), |
|
| 194 | - 'not_found' => __( 'No discounts found', 'invoicing' ), |
|
| 195 | - 'not_found_in_trash' => __( 'No discounts found in trash', 'invoicing' ), |
|
| 196 | - 'parent' => __( 'Parent discount', 'invoicing' ), |
|
| 197 | - 'featured_image' => __( 'Discount image', 'invoicing' ), |
|
| 198 | - 'set_featured_image' => __( 'Set discount image', 'invoicing' ), |
|
| 199 | - 'remove_featured_image' => __( 'Remove discount image', 'invoicing' ), |
|
| 200 | - 'use_featured_image' => __( 'Use as discount image', 'invoicing' ), |
|
| 201 | - 'insert_into_item' => __( 'Insert into discount', 'invoicing' ), |
|
| 202 | - 'uploaded_to_this_item' => __( 'Uploaded to this discount', 'invoicing' ), |
|
| 203 | - 'filter_items_list' => __( 'Filter discounts', 'invoicing' ), |
|
| 204 | - 'items_list_navigation' => __( 'Discount navigation', 'invoicing' ), |
|
| 205 | - 'items_list' => __( 'Discounts list', 'invoicing' ), |
|
| 182 | + 'name' => __('Discounts', 'invoicing'), |
|
| 183 | + 'singular_name' => __('Discount', 'invoicing'), |
|
| 184 | + 'all_items' => __('Discounts', 'invoicing'), |
|
| 185 | + 'menu_name' => _x('Discounts', 'Admin menu name', 'invoicing'), |
|
| 186 | + 'add_new' => __('Add New', 'invoicing'), |
|
| 187 | + 'add_new_item' => __('Add new discount', 'invoicing'), |
|
| 188 | + 'edit' => __('Edit', 'invoicing'), |
|
| 189 | + 'edit_item' => __('Edit discount', 'invoicing'), |
|
| 190 | + 'new_item' => __('New discount', 'invoicing'), |
|
| 191 | + 'view_item' => __('View discount', 'invoicing'), |
|
| 192 | + 'view_items' => __('View Discounts', 'invoicing'), |
|
| 193 | + 'search_items' => __('Search discounts', 'invoicing'), |
|
| 194 | + 'not_found' => __('No discounts found', 'invoicing'), |
|
| 195 | + 'not_found_in_trash' => __('No discounts found in trash', 'invoicing'), |
|
| 196 | + 'parent' => __('Parent discount', 'invoicing'), |
|
| 197 | + 'featured_image' => __('Discount image', 'invoicing'), |
|
| 198 | + 'set_featured_image' => __('Set discount image', 'invoicing'), |
|
| 199 | + 'remove_featured_image' => __('Remove discount image', 'invoicing'), |
|
| 200 | + 'use_featured_image' => __('Use as discount image', 'invoicing'), |
|
| 201 | + 'insert_into_item' => __('Insert into discount', 'invoicing'), |
|
| 202 | + 'uploaded_to_this_item' => __('Uploaded to this discount', 'invoicing'), |
|
| 203 | + 'filter_items_list' => __('Filter discounts', 'invoicing'), |
|
| 204 | + 'items_list_navigation' => __('Discount navigation', 'invoicing'), |
|
| 205 | + 'items_list' => __('Discounts list', 'invoicing'), |
|
| 206 | 206 | ), |
| 207 | - 'description' => __( 'This is where you can add new discounts that users can use in invoices.', 'invoicing' ), |
|
| 207 | + 'description' => __('This is where you can add new discounts that users can use in invoices.', 'invoicing'), |
|
| 208 | 208 | 'public' => false, |
| 209 | 209 | 'can_export' => true, |
| 210 | 210 | '_builtin' => false, |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | 'map_meta_cap' => true, |
| 218 | 218 | 'has_archive' => false, |
| 219 | 219 | 'hierarchical' => false, |
| 220 | - 'supports' => array( 'title', 'excerpt' ), |
|
| 220 | + 'supports' => array('title', 'excerpt'), |
|
| 221 | 221 | 'show_in_nav_menus' => false, |
| 222 | 222 | 'show_in_admin_bar' => true, |
| 223 | 223 | 'menu_position' => null, |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | ) |
| 226 | 226 | ); |
| 227 | 227 | |
| 228 | - do_action( 'getpaid_after_register_post_types' ); |
|
| 228 | + do_action('getpaid_after_register_post_types'); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -238,79 +238,79 @@ discard block |
||
| 238 | 238 | array( |
| 239 | 239 | |
| 240 | 240 | 'wpi-pending' => array( |
| 241 | - 'label' => _x( 'Pending Payment', 'Invoice status', 'invoicing' ), |
|
| 241 | + 'label' => _x('Pending Payment', 'Invoice status', 'invoicing'), |
|
| 242 | 242 | 'public' => true, |
| 243 | 243 | 'exclude_from_search' => true, |
| 244 | 244 | 'show_in_admin_all_list' => true, |
| 245 | 245 | 'show_in_admin_status_list' => true, |
| 246 | 246 | /* translators: %s: number of invoices */ |
| 247 | - 'label_count' => _n_noop( 'Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing' ), |
|
| 247 | + 'label_count' => _n_noop('Pending Payment <span class="count">(%s)</span>', 'Pending Payment <span class="count">(%s)</span>', 'invoicing'), |
|
| 248 | 248 | ), |
| 249 | 249 | |
| 250 | 250 | 'wpi-processing' => array( |
| 251 | - 'label' => _x( 'Processing', 'Invoice status', 'invoicing' ), |
|
| 251 | + 'label' => _x('Processing', 'Invoice status', 'invoicing'), |
|
| 252 | 252 | 'public' => true, |
| 253 | 253 | 'exclude_from_search' => true, |
| 254 | 254 | 'show_in_admin_all_list' => true, |
| 255 | 255 | 'show_in_admin_status_list' => true, |
| 256 | 256 | /* translators: %s: number of invoices */ |
| 257 | - 'label_count' => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing' ), |
|
| 257 | + 'label_count' => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'invoicing'), |
|
| 258 | 258 | ), |
| 259 | 259 | |
| 260 | 260 | 'wpi-onhold' => array( |
| 261 | - 'label' => _x( 'On Hold', 'Invoice status', 'invoicing' ), |
|
| 261 | + 'label' => _x('On Hold', 'Invoice status', 'invoicing'), |
|
| 262 | 262 | 'public' => true, |
| 263 | 263 | 'exclude_from_search' => true, |
| 264 | 264 | 'show_in_admin_all_list' => true, |
| 265 | 265 | 'show_in_admin_status_list' => true, |
| 266 | 266 | /* translators: %s: number of invoices */ |
| 267 | - 'label_count' => _n_noop( 'On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing' ), |
|
| 267 | + 'label_count' => _n_noop('On Hold <span class="count">(%s)</span>', 'On Hold <span class="count">(%s)</span>', 'invoicing'), |
|
| 268 | 268 | ), |
| 269 | 269 | |
| 270 | 270 | 'wpi-cancelled' => array( |
| 271 | - 'label' => _x( 'Cancelled', 'Invoice status', 'invoicing' ), |
|
| 271 | + 'label' => _x('Cancelled', 'Invoice status', 'invoicing'), |
|
| 272 | 272 | 'public' => true, |
| 273 | 273 | 'exclude_from_search' => true, |
| 274 | 274 | 'show_in_admin_all_list' => true, |
| 275 | 275 | 'show_in_admin_status_list' => true, |
| 276 | 276 | /* translators: %s: number of invoices */ |
| 277 | - 'label_count' => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing' ), |
|
| 277 | + 'label_count' => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'invoicing'), |
|
| 278 | 278 | ), |
| 279 | 279 | |
| 280 | 280 | 'wpi-refunded' => array( |
| 281 | - 'label' => _x( 'Refunded', 'Invoice status', 'invoicing' ), |
|
| 281 | + 'label' => _x('Refunded', 'Invoice status', 'invoicing'), |
|
| 282 | 282 | 'public' => true, |
| 283 | 283 | 'exclude_from_search' => true, |
| 284 | 284 | 'show_in_admin_all_list' => true, |
| 285 | 285 | 'show_in_admin_status_list' => true, |
| 286 | 286 | /* translators: %s: number of invoices */ |
| 287 | - 'label_count' => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing' ), |
|
| 287 | + 'label_count' => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'invoicing'), |
|
| 288 | 288 | ), |
| 289 | 289 | |
| 290 | 290 | 'wpi-failed' => array( |
| 291 | - 'label' => _x( 'Failed', 'Invoice status', 'invoicing' ), |
|
| 291 | + 'label' => _x('Failed', 'Invoice status', 'invoicing'), |
|
| 292 | 292 | 'public' => true, |
| 293 | 293 | 'exclude_from_search' => true, |
| 294 | 294 | 'show_in_admin_all_list' => true, |
| 295 | 295 | 'show_in_admin_status_list' => true, |
| 296 | 296 | /* translators: %s: number of invoices */ |
| 297 | - 'label_count' => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing' ), |
|
| 297 | + 'label_count' => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'invoicing'), |
|
| 298 | 298 | ), |
| 299 | 299 | |
| 300 | 300 | 'wpi-renewal' => array( |
| 301 | - 'label' => _x( 'Renewal', 'Invoice status', 'invoicing' ), |
|
| 301 | + 'label' => _x('Renewal', 'Invoice status', 'invoicing'), |
|
| 302 | 302 | 'public' => true, |
| 303 | 303 | 'exclude_from_search' => true, |
| 304 | 304 | 'show_in_admin_all_list' => true, |
| 305 | 305 | 'show_in_admin_status_list' => true, |
| 306 | 306 | /* translators: %s: number of invoices */ |
| 307 | - 'label_count' => _n_noop( 'Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing' ), |
|
| 307 | + 'label_count' => _n_noop('Renewal <span class="count">(%s)</span>', 'Renewal <span class="count">(%s)</span>', 'invoicing'), |
|
| 308 | 308 | ), |
| 309 | 309 | ) |
| 310 | 310 | ); |
| 311 | 311 | |
| 312 | - foreach ( $invoice_statuses as $invoice_statuse => $args ) { |
|
| 313 | - register_post_status( $invoice_statuse, $args ); |
|
| 312 | + foreach ($invoice_statuses as $invoice_statuse => $args) { |
|
| 313 | + register_post_status($invoice_statuse, $args); |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | |
@@ -326,8 +326,8 @@ discard block |
||
| 326 | 326 | * |
| 327 | 327 | */ |
| 328 | 328 | public static function maybe_flush_rewrite_rules() { |
| 329 | - if ( ! get_option( 'getpaid_flushed_rewrite_rules' ) ) { |
|
| 330 | - update_option( 'getpaid_flushed_rewrite_rules', '1' ); |
|
| 329 | + if (!get_option('getpaid_flushed_rewrite_rules')) { |
|
| 330 | + update_option('getpaid_flushed_rewrite_rules', '1'); |
|
| 331 | 331 | self::flush_rewrite_rules(); |
| 332 | 332 | } |
| 333 | 333 | } |