@@ -13,42 +13,42 @@ |
||
| 13 | 13 | |
| 14 | 14 | foreach ( array_keys( $widget->get_subscriptions_table_columns() ) as $column ) : |
| 15 | 15 | |
| 16 | - $class = sanitize_html_class( $column ); |
|
| 17 | - echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
|
| 16 | + $class = sanitize_html_class( $column ); |
|
| 17 | + echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
|
| 18 | 18 | |
| 19 | - do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
| 19 | + do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
| 20 | 20 | |
| 21 | - switch ( $column ) : |
|
| 21 | + switch ( $column ) : |
|
| 22 | 22 | |
| 23 | - case 'subscription': |
|
| 24 | - $subscription_id = (int) $subscription->get_id(); |
|
| 25 | - $url = esc_url( $subscription->get_view_url() ); |
|
| 26 | - $id_label = sprintf( |
|
| 27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 28 | - (int) $subscription->get_id() |
|
| 29 | - ); |
|
| 30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 31 | - break; |
|
| 23 | + case 'subscription': |
|
| 24 | + $subscription_id = (int) $subscription->get_id(); |
|
| 25 | + $url = esc_url( $subscription->get_view_url() ); |
|
| 26 | + $id_label = sprintf( |
|
| 27 | + esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 28 | + (int) $subscription->get_id() |
|
| 29 | + ); |
|
| 30 | + echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 31 | + break; |
|
| 32 | 32 | |
| 33 | - case 'status': |
|
| 34 | - echo esc_html( $subscription->get_status_label() ); |
|
| 35 | - break; |
|
| 33 | + case 'status': |
|
| 34 | + echo esc_html( $subscription->get_status_label() ); |
|
| 35 | + break; |
|
| 36 | 36 | |
| 37 | - case 'renewal-date': |
|
| 38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | - echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
| 40 | - break; |
|
| 37 | + case 'renewal-date': |
|
| 38 | + $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | + echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
| 40 | + break; |
|
| 41 | 41 | |
| 42 | - case 'amount': |
|
| 43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 46 | - break; |
|
| 42 | + case 'amount': |
|
| 43 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | + echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 46 | + break; |
|
| 47 | 47 | |
| 48 | - endswitch; |
|
| 48 | + endswitch; |
|
| 49 | 49 | |
| 50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 50 | + do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 51 | 51 | |
| 52 | - echo '</td>'; |
|
| 52 | + echo '</td>'; |
|
| 53 | 53 | |
| 54 | 54 | endforeach; |
@@ -20,35 +20,35 @@ |
||
| 20 | 20 | |
| 21 | 21 | switch ( $column ) : |
| 22 | 22 | |
| 23 | - case 'subscription': |
|
| 24 | - $subscription_id = (int) $subscription->get_id(); |
|
| 25 | - $url = esc_url( $subscription->get_view_url() ); |
|
| 26 | - $id_label = sprintf( |
|
| 27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 28 | - (int) $subscription->get_id() |
|
| 29 | - ); |
|
| 30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 31 | - break; |
|
| 32 | - |
|
| 33 | - case 'status': |
|
| 34 | - echo esc_html( $subscription->get_status_label() ); |
|
| 35 | - break; |
|
| 36 | - |
|
| 37 | - case 'renewal-date': |
|
| 38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | - echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
| 40 | - break; |
|
| 41 | - |
|
| 42 | - case 'amount': |
|
| 43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 46 | - break; |
|
| 47 | - |
|
| 48 | - endswitch; |
|
| 49 | - |
|
| 50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 51 | - |
|
| 52 | - echo '</td>'; |
|
| 53 | - |
|
| 54 | -endforeach; |
|
| 23 | + case 'subscription': |
|
| 24 | + $subscription_id = (int) $subscription->get_id(); |
|
| 25 | + $url = esc_url( $subscription->get_view_url() ); |
|
| 26 | + $id_label = sprintf( |
|
| 27 | + esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 28 | + (int) $subscription->get_id() |
|
| 29 | + ); |
|
| 30 | + echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 31 | + break; |
|
| 32 | + |
|
| 33 | + case 'status': |
|
| 34 | + echo esc_html( $subscription->get_status_label() ); |
|
| 35 | + break; |
|
| 36 | + |
|
| 37 | + case 'renewal-date': |
|
| 38 | + $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | + echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
| 40 | + break; |
|
| 41 | + |
|
| 42 | + case 'amount': |
|
| 43 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | + echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 46 | + break; |
|
| 47 | + |
|
| 48 | + endswitch; |
|
| 49 | + |
|
| 50 | + do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 51 | + |
|
| 52 | + echo '</td>'; |
|
| 53 | + |
|
| 54 | + endforeach; |
|
@@ -9,45 +9,45 @@ |
||
| 9 | 9 | * @var WPInv_Subscriptions_Widget $widget |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -defined( 'ABSPATH' ) || exit; |
|
| 12 | +defined('ABSPATH') || exit; |
|
| 13 | 13 | |
| 14 | -foreach ( array_keys( $widget->get_subscriptions_table_columns() ) as $column ) : |
|
| 14 | +foreach (array_keys($widget->get_subscriptions_table_columns()) as $column) : |
|
| 15 | 15 | |
| 16 | - $class = sanitize_html_class( $column ); |
|
| 16 | + $class = sanitize_html_class($column); |
|
| 17 | 17 | echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
| 18 | 18 | |
| 19 | - do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
| 19 | + do_action("getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription); |
|
| 20 | 20 | |
| 21 | - switch ( $column ) : |
|
| 21 | + switch ($column) : |
|
| 22 | 22 | |
| 23 | 23 | case 'subscription': |
| 24 | 24 | $subscription_id = (int) $subscription->get_id(); |
| 25 | - $url = esc_url( $subscription->get_view_url() ); |
|
| 25 | + $url = esc_url($subscription->get_view_url()); |
|
| 26 | 26 | $id_label = sprintf( |
| 27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
| 27 | + esc_attr_x('#%s', 'subscription id', 'invoicing'), |
|
| 28 | 28 | (int) $subscription->get_id() |
| 29 | 29 | ); |
| 30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
| 30 | + echo $widget->add_row_actions("<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription); |
|
| 31 | 31 | break; |
| 32 | 32 | |
| 33 | 33 | case 'status': |
| 34 | - echo esc_html( $subscription->get_status_label() ); |
|
| 34 | + echo esc_html($subscription->get_status_label()); |
|
| 35 | 35 | break; |
| 36 | 36 | |
| 37 | 37 | case 'renewal-date': |
| 38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
| 39 | - echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
| 38 | + $renewal = getpaid_format_date_value($subscription->get_next_renewal_date()); |
|
| 39 | + echo $subscription->is_active() ? esc_html($renewal) : '—'; |
|
| 40 | 40 | break; |
| 41 | 41 | |
| 42 | 42 | case 'amount': |
| 43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
| 43 | + $frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency(), ''); |
|
| 44 | + $amount = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency()); |
|
| 45 | + echo wp_kses_post("<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>"); |
|
| 46 | 46 | break; |
| 47 | 47 | |
| 48 | 48 | endswitch; |
| 49 | 49 | |
| 50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
| 50 | + do_action("getpaid_subscriptions_frontend_subscription_table_$column", $subscription); |
|
| 51 | 51 | |
| 52 | 52 | echo '</td>'; |
| 53 | 53 | |
@@ -46,62 +46,62 @@ discard block |
||
| 46 | 46 | <td style="width: 65%"> |
| 47 | 47 | <?php |
| 48 | 48 | |
| 49 | - switch ( $key ) { |
|
| 49 | + switch ( $key ) { |
|
| 50 | 50 | |
| 51 | - case 'status': |
|
| 52 | - echo esc_html( $subscription->get_status_label() ); |
|
| 53 | - break; |
|
| 51 | + case 'status': |
|
| 52 | + echo esc_html( $subscription->get_status_label() ); |
|
| 53 | + break; |
|
| 54 | 54 | |
| 55 | - case 'start_date': |
|
| 56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 57 | - break; |
|
| 55 | + case 'start_date': |
|
| 56 | + echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 57 | + break; |
|
| 58 | 58 | |
| 59 | - case 'expiry_date': |
|
| 60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 61 | - break; |
|
| 59 | + case 'expiry_date': |
|
| 60 | + echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 61 | + break; |
|
| 62 | 62 | |
| 63 | - case 'initial_amount': |
|
| 64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 63 | + case 'initial_amount': |
|
| 64 | + echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 65 | 65 | |
| 66 | - if ( $subscription->has_trial_period() ) { |
|
| 66 | + if ( $subscription->has_trial_period() ) { |
|
| 67 | 67 | |
| 68 | - echo "<small class='text-muted'> "; |
|
| 69 | - printf( |
|
| 70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | - esc_html( $subscription->get_trial_period() ) |
|
| 72 | - ); |
|
| 73 | - echo '</small>'; |
|
| 68 | + echo "<small class='text-muted'> "; |
|
| 69 | + printf( |
|
| 70 | + _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | + esc_html( $subscription->get_trial_period() ) |
|
| 72 | + ); |
|
| 73 | + echo '</small>'; |
|
| 74 | 74 | |
| 75 | - } |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - break; |
|
| 77 | + break; |
|
| 78 | 78 | |
| 79 | - case 'recurring_amount': |
|
| 80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 83 | - break; |
|
| 79 | + case 'recurring_amount': |
|
| 80 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | + echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 83 | + break; |
|
| 84 | 84 | |
| 85 | - case 'item': |
|
| 86 | - if ( empty( $subscription_group ) ) { |
|
| 87 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 88 | - } else { |
|
| 89 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 90 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 91 | - } |
|
| 85 | + case 'item': |
|
| 86 | + if ( empty( $subscription_group ) ) { |
|
| 87 | + echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 88 | + } else { |
|
| 89 | + $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 90 | + echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - break; |
|
| 93 | + break; |
|
| 94 | 94 | |
| 95 | - case 'payments': |
|
| 96 | - $max_activations = (int) $subscription->get_bill_times(); |
|
| 97 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
| 95 | + case 'payments': |
|
| 96 | + $max_activations = (int) $subscription->get_bill_times(); |
|
| 97 | + echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
| 98 | 98 | |
| 99 | - break; |
|
| 99 | + break; |
|
| 100 | 100 | |
| 101 | - } |
|
| 102 | - do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
| 101 | + } |
|
| 102 | + do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
| 103 | 103 | |
| 104 | - ?> |
|
| 104 | + ?> |
|
| 105 | 105 | </td> |
| 106 | 106 | |
| 107 | 107 | </tr> |
@@ -128,17 +128,17 @@ discard block |
||
| 128 | 128 | <span class="form-text"> |
| 129 | 129 | |
| 130 | 130 | <?php |
| 131 | - if ( $subscription->can_cancel() ) { |
|
| 132 | - printf( |
|
| 133 | - '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
|
| 134 | - esc_url( $subscription->get_cancel_url() ), |
|
| 135 | - esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
| 136 | - __( 'Cancel Subscription', 'invoicing' ) |
|
| 137 | - ); |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
| 141 | - ?> |
|
| 131 | + if ( $subscription->can_cancel() ) { |
|
| 132 | + printf( |
|
| 133 | + '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
|
| 134 | + esc_url( $subscription->get_cancel_url() ), |
|
| 135 | + esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
| 136 | + __( 'Cancel Subscription', 'invoicing' ) |
|
| 137 | + ); |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
| 141 | + ?> |
|
| 142 | 142 | |
| 143 | 143 | <a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php _e( 'Go Back', 'invoicing' ); ?></a> |
| 144 | 144 | </span> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Template that prints a single subscription's details |
| 4 | 4 | * |
@@ -9,19 +9,19 @@ discard block |
||
| 9 | 9 | * @var WPInv_Subscriptions_Widget $widget |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -defined( 'ABSPATH' ) || exit; |
|
| 12 | + defined( 'ABSPATH' ) || exit; |
|
| 13 | 13 | |
| 14 | -do_action( 'getpaid_single_subscription_before_notices', $subscription ); |
|
| 14 | + do_action( 'getpaid_single_subscription_before_notices', $subscription ); |
|
| 15 | 15 | |
| 16 | -// Display errors and notices. |
|
| 17 | -wpinv_print_errors(); |
|
| 16 | + // Display errors and notices. |
|
| 17 | + wpinv_print_errors(); |
|
| 18 | 18 | |
| 19 | -$subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() ); |
|
| 20 | -$subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
| 19 | + $subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() ); |
|
| 20 | + $subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
| 21 | 21 | |
| 22 | -do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups ); |
|
| 22 | + do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups ); |
|
| 23 | 23 | |
| 24 | -?> |
|
| 24 | + ?> |
|
| 25 | 25 | |
| 26 | 26 | <style> |
| 27 | 27 | .entry-header, |
@@ -46,59 +46,59 @@ discard block |
||
| 46 | 46 | <td style="width: 65%"> |
| 47 | 47 | <?php |
| 48 | 48 | |
| 49 | - switch ( $key ) { |
|
| 49 | + switch ( $key ) { |
|
| 50 | 50 | |
| 51 | - case 'status': |
|
| 52 | - echo esc_html( $subscription->get_status_label() ); |
|
| 53 | - break; |
|
| 51 | + case 'status': |
|
| 52 | + echo esc_html( $subscription->get_status_label() ); |
|
| 53 | + break; |
|
| 54 | 54 | |
| 55 | - case 'start_date': |
|
| 56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 57 | - break; |
|
| 55 | + case 'start_date': |
|
| 56 | + echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 57 | + break; |
|
| 58 | 58 | |
| 59 | - case 'expiry_date': |
|
| 60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 61 | - break; |
|
| 59 | + case 'expiry_date': |
|
| 60 | + echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 61 | + break; |
|
| 62 | 62 | |
| 63 | - case 'initial_amount': |
|
| 64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 63 | + case 'initial_amount': |
|
| 64 | + echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 65 | 65 | |
| 66 | - if ( $subscription->has_trial_period() ) { |
|
| 66 | + if ( $subscription->has_trial_period() ) { |
|
| 67 | 67 | |
| 68 | - echo "<small class='text-muted'> "; |
|
| 69 | - printf( |
|
| 70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | - esc_html( $subscription->get_trial_period() ) |
|
| 72 | - ); |
|
| 73 | - echo '</small>'; |
|
| 68 | + echo "<small class='text-muted'> "; |
|
| 69 | + printf( |
|
| 70 | + _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | + esc_html( $subscription->get_trial_period() ) |
|
| 72 | + ); |
|
| 73 | + echo '</small>'; |
|
| 74 | 74 | |
| 75 | - } |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - break; |
|
| 77 | + break; |
|
| 78 | 78 | |
| 79 | - case 'recurring_amount': |
|
| 80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 83 | - break; |
|
| 79 | + case 'recurring_amount': |
|
| 80 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | + echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 83 | + break; |
|
| 84 | 84 | |
| 85 | - case 'item': |
|
| 86 | - if ( empty( $subscription_group ) ) { |
|
| 87 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 88 | - } else { |
|
| 89 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 90 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 91 | - } |
|
| 85 | + case 'item': |
|
| 86 | + if ( empty( $subscription_group ) ) { |
|
| 87 | + echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 88 | + } else { |
|
| 89 | + $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 90 | + echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - break; |
|
| 93 | + break; |
|
| 94 | 94 | |
| 95 | - case 'payments': |
|
| 96 | - $max_activations = (int) $subscription->get_bill_times(); |
|
| 97 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
| 95 | + case 'payments': |
|
| 96 | + $max_activations = (int) $subscription->get_bill_times(); |
|
| 97 | + echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
| 98 | 98 | |
| 99 | - break; |
|
| 99 | + break; |
|
| 100 | 100 | |
| 101 | - } |
|
| 101 | + } |
|
| 102 | 102 | do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
| 103 | 103 | |
| 104 | 104 | ?> |
@@ -9,17 +9,17 @@ discard block |
||
| 9 | 9 | * @var WPInv_Subscriptions_Widget $widget |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -defined( 'ABSPATH' ) || exit; |
|
| 12 | +defined('ABSPATH') || exit; |
|
| 13 | 13 | |
| 14 | -do_action( 'getpaid_single_subscription_before_notices', $subscription ); |
|
| 14 | +do_action('getpaid_single_subscription_before_notices', $subscription); |
|
| 15 | 15 | |
| 16 | 16 | // Display errors and notices. |
| 17 | 17 | wpinv_print_errors(); |
| 18 | 18 | |
| 19 | -$subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() ); |
|
| 20 | -$subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
| 19 | +$subscription_groups = getpaid_get_invoice_subscription_groups($subscription->get_parent_invoice_id()); |
|
| 20 | +$subscription_group = getpaid_get_invoice_subscription_group($subscription->get_parent_invoice_id(), $subscription->get_id()); |
|
| 21 | 21 | |
| 22 | -do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups ); |
|
| 22 | +do_action('getpaid_before_single_subscription', $subscription, $subscription_groups); |
|
| 23 | 23 | |
| 24 | 24 | ?> |
| 25 | 25 | |
@@ -31,44 +31,44 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | </style> |
| 33 | 33 | |
| 34 | -<h2 class="mb-1 h4"><?php _e( 'Subscription Details', 'invoicing' ); ?></h2> |
|
| 34 | +<h2 class="mb-1 h4"><?php _e('Subscription Details', 'invoicing'); ?></h2> |
|
| 35 | 35 | <table class="table table-bordered"> |
| 36 | 36 | <tbody> |
| 37 | 37 | |
| 38 | - <?php foreach ( $widget->get_single_subscription_columns( $subscription ) as $key => $label ) : ?> |
|
| 38 | + <?php foreach ($widget->get_single_subscription_columns($subscription) as $key => $label) : ?> |
|
| 39 | 39 | |
| 40 | - <tr class="getpaid-subscription-meta-<?php echo sanitize_html_class( $key ); ?>"> |
|
| 40 | + <tr class="getpaid-subscription-meta-<?php echo sanitize_html_class($key); ?>"> |
|
| 41 | 41 | |
| 42 | 42 | <th class="font-weight-bold" style="width: 35%"> |
| 43 | - <?php echo esc_html( $label ); ?> |
|
| 43 | + <?php echo esc_html($label); ?> |
|
| 44 | 44 | </th> |
| 45 | 45 | |
| 46 | 46 | <td style="width: 65%"> |
| 47 | 47 | <?php |
| 48 | 48 | |
| 49 | - switch ( $key ) { |
|
| 49 | + switch ($key) { |
|
| 50 | 50 | |
| 51 | 51 | case 'status': |
| 52 | - echo esc_html( $subscription->get_status_label() ); |
|
| 52 | + echo esc_html($subscription->get_status_label()); |
|
| 53 | 53 | break; |
| 54 | 54 | |
| 55 | 55 | case 'start_date': |
| 56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
| 56 | + echo esc_html(getpaid_format_date_value($subscription->get_date_created())); |
|
| 57 | 57 | break; |
| 58 | 58 | |
| 59 | 59 | case 'expiry_date': |
| 60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
| 60 | + echo esc_html(getpaid_format_date_value($subscription->get_next_renewal_date())); |
|
| 61 | 61 | break; |
| 62 | 62 | |
| 63 | 63 | case 'initial_amount': |
| 64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 64 | + echo wpinv_price($subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency()); |
|
| 65 | 65 | |
| 66 | - if ( $subscription->has_trial_period() ) { |
|
| 66 | + if ($subscription->has_trial_period()) { |
|
| 67 | 67 | |
| 68 | 68 | echo "<small class='text-muted'> "; |
| 69 | 69 | printf( |
| 70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
| 71 | - esc_html( $subscription->get_trial_period() ) |
|
| 70 | + _x('( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing'), |
|
| 71 | + esc_html($subscription->get_trial_period()) |
|
| 72 | 72 | ); |
| 73 | 73 | echo '</small>'; |
| 74 | 74 | |
@@ -77,29 +77,29 @@ discard block |
||
| 77 | 77 | break; |
| 78 | 78 | |
| 79 | 79 | case 'recurring_amount': |
| 80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
| 81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
| 82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
| 80 | + $frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency(), ''); |
|
| 81 | + $amount = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency()); |
|
| 82 | + echo wp_kses_post(strtolower("<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>")); |
|
| 83 | 83 | break; |
| 84 | 84 | |
| 85 | 85 | case 'item': |
| 86 | - if ( empty( $subscription_group ) ) { |
|
| 87 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
| 86 | + if (empty($subscription_group)) { |
|
| 87 | + echo wp_kses_post(WPInv_Subscriptions_List_Table::generate_item_markup($subscription->get_product_id())); |
|
| 88 | 88 | } else { |
| 89 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
| 90 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
| 89 | + $markup = array_map(array('WPInv_Subscriptions_List_Table', 'generate_item_markup'), array_keys($subscription_group['items'])); |
|
| 90 | + echo wp_kses_post(implode(' | ', $markup)); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | break; |
| 94 | 94 | |
| 95 | 95 | case 'payments': |
| 96 | 96 | $max_activations = (int) $subscription->get_bill_times(); |
| 97 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
| 97 | + echo ((int) $subscription->get_times_billed()) . ' / ' . (empty($max_activations) ? '∞' : (int) $max_activations); |
|
| 98 | 98 | |
| 99 | 99 | break; |
| 100 | 100 | |
| 101 | 101 | } |
| 102 | - do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
| 102 | + do_action("getpaid_render_single_subscription_column_$key", $subscription); |
|
| 103 | 103 | |
| 104 | 104 | ?> |
| 105 | 105 | </td> |
@@ -111,34 +111,34 @@ discard block |
||
| 111 | 111 | </tbody> |
| 112 | 112 | </table> |
| 113 | 113 | |
| 114 | -<?php if ( ! empty( $subscription_group ) ) : ?> |
|
| 115 | - <h2 class='mt-5 mb-1 h4'><?php _e( 'Subscription Items', 'invoicing' ); ?></h2> |
|
| 116 | - <?php getpaid_admin_subscription_item_details_metabox( $subscription ); ?> |
|
| 114 | +<?php if (!empty($subscription_group)) : ?> |
|
| 115 | + <h2 class='mt-5 mb-1 h4'><?php _e('Subscription Items', 'invoicing'); ?></h2> |
|
| 116 | + <?php getpaid_admin_subscription_item_details_metabox($subscription); ?> |
|
| 117 | 117 | <?php endif; ?> |
| 118 | 118 | |
| 119 | -<h2 class='mt-5 mb-1 h4'><?php _e( 'Related Invoices', 'invoicing' ); ?></h2> |
|
| 119 | +<h2 class='mt-5 mb-1 h4'><?php _e('Related Invoices', 'invoicing'); ?></h2> |
|
| 120 | 120 | |
| 121 | -<?php echo getpaid_admin_subscription_invoice_details_metabox( $subscription ); ?> |
|
| 121 | +<?php echo getpaid_admin_subscription_invoice_details_metabox($subscription); ?> |
|
| 122 | 122 | |
| 123 | -<?php if ( 1 < count( $subscription_groups ) ) : ?> |
|
| 124 | - <h2 class='mt-5 mb-1 h4'><?php _e( 'Related Subscriptions', 'invoicing' ); ?></h2> |
|
| 125 | - <?php getpaid_admin_subscription_related_subscriptions_metabox( $subscription ); ?> |
|
| 123 | +<?php if (1 < count($subscription_groups)) : ?> |
|
| 124 | + <h2 class='mt-5 mb-1 h4'><?php _e('Related Subscriptions', 'invoicing'); ?></h2> |
|
| 125 | + <?php getpaid_admin_subscription_related_subscriptions_metabox($subscription); ?> |
|
| 126 | 126 | <?php endif; ?> |
| 127 | 127 | |
| 128 | 128 | <span class="form-text"> |
| 129 | 129 | |
| 130 | 130 | <?php |
| 131 | - if ( $subscription->can_cancel() ) { |
|
| 131 | + if ($subscription->can_cancel()) { |
|
| 132 | 132 | printf( |
| 133 | 133 | '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
| 134 | - esc_url( $subscription->get_cancel_url() ), |
|
| 135 | - esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
| 136 | - __( 'Cancel Subscription', 'invoicing' ) |
|
| 134 | + esc_url($subscription->get_cancel_url()), |
|
| 135 | + esc_attr__('Are you sure you want to cancel this subscription?', 'invoicing'), |
|
| 136 | + __('Cancel Subscription', 'invoicing') |
|
| 137 | 137 | ); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
| 140 | + do_action('getpaid-single-subscription-page-actions', $subscription); |
|
| 141 | 141 | ?> |
| 142 | 142 | |
| 143 | - <a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php _e( 'Go Back', 'invoicing' ); ?></a> |
|
| 143 | + <a href="<?php echo esc_url(getpaid_get_tab_url('gp-subscriptions', get_permalink((int) wpinv_get_option('invoice_subscription_page')))); ?>" class="btn btn-secondary btn-sm"><?php _e('Go Back', 'invoicing'); ?></a> |
|
| 144 | 144 | </span> |
@@ -7,11 +7,11 @@ |
||
| 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 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The gateway select text', 'invoicing' ); ?></label> |
|
| 15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The gateway select text', 'invoicing'); ?></label> |
|
| 16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
| 17 | 17 | </div> |
@@ -7,12 +7,12 @@ |
||
| 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 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Enter your text', 'invoicing' ); ?></label> |
|
| 15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('Enter your text', 'invoicing'); ?></label> |
|
| 16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
| 17 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
| 17 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
| 18 | 18 | </div> |
@@ -7,11 +7,11 @@ |
||
| 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 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The total payable text', 'invoicing' ); ?></label> |
|
| 15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The total payable text', 'invoicing'); ?></label> |
|
| 16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
| 17 | 17 | </div> |
@@ -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> |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | <div class='form-group'> |
| 14 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The IP Address text', 'invoicing' ); ?></label> |
|
| 14 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The IP Address text', 'invoicing'); ?></label> |
|
| 15 | 15 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
| 16 | 16 | </div> |
@@ -7,31 +7,31 @@ discard block |
||
| 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( 'Field Label', 'invoicing' ); ?></span> |
|
| 16 | + <span><?php esc_html_e('Field Label', 'invoicing'); ?></span> |
|
| 17 | 17 | <input v-model="active_form_element.label" class="form-control" type="text"/> |
| 18 | 18 | </label> |
| 19 | 19 | </div> |
| 20 | 20 | |
| 21 | 21 | <div class='form-group'> |
| 22 | 22 | <label class="d-block"> |
| 23 | - <span><?php esc_html_e( 'Max File Number', 'invoicing' ); ?></span> |
|
| 23 | + <span><?php esc_html_e('Max File Number', 'invoicing'); ?></span> |
|
| 24 | 24 | <input v-model="active_form_element.max_file_num" class="form-control" min="1" type="number" /> |
| 25 | - <small class="form-text text-muted"><?php _e( 'How many files can be uploaded?', 'invoicing' ); ?></small> |
|
| 25 | + <small class="form-text text-muted"><?php _e('How many files can be uploaded?', 'invoicing'); ?></small> |
|
| 26 | 26 | </label> |
| 27 | 27 | </div> |
| 28 | 28 | |
| 29 | 29 | <div class='form-group'> |
| 30 | 30 | <label class="d-block"> |
| 31 | - <span><?php esc_html_e( 'Allowed File types', 'invoicing' ); ?></span> |
|
| 31 | + <span><?php esc_html_e('Allowed File types', 'invoicing'); ?></span> |
|
| 32 | 32 | <gpselect2 class='form-control custom-select' v-model='active_form_element.file_types' multiple> |
| 33 | - <?php foreach ( getpaid_get_allowed_mime_types() as $ext_regex => $mime_type ) : ?> |
|
| 34 | - <option value="<?php echo esc_attr( $ext_regex ); ?>"><?php echo esc_html( "$mime_type" ); ?></option> |
|
| 33 | + <?php foreach (getpaid_get_allowed_mime_types() as $ext_regex => $mime_type) : ?> |
|
| 34 | + <option value="<?php echo esc_attr($ext_regex); ?>"><?php echo esc_html("$mime_type"); ?></option> |
|
| 35 | 35 | <?php endforeach; ?> |
| 36 | 36 | </gpselect2> |
| 37 | 37 | </label> |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <div class='form-group'> |
| 41 | 41 | <label class="d-block"> |
| 42 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
| 43 | - <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea> |
|
| 44 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
| 42 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
| 43 | + <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='active_form_element.description' class='form-control' rows='3'></textarea> |
|
| 44 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
| 45 | 45 | </label> |
| 46 | 46 | </div> |
| 47 | 47 | |
@@ -49,20 +49,20 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | <div class='form-group form-check'> |
| 51 | 51 | <input :id="active_form_element.id + '_edit'" v-model='active_form_element.required' type='checkbox' class='form-check-input' /> |
| 52 | - <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Is this field required?', 'invoicing' ); ?></label> |
|
| 52 | + <label class='form-check-label' :for="active_form_element.id + '_edit'"><?php esc_html_e('Is this field required?', 'invoicing'); ?></label> |
|
| 53 | 53 | </div> |
| 54 | 54 | |
| 55 | 55 | <div class='form-group form-check'> |
| 56 | 56 | <input :id="active_form_element.id + '_add_meta'" v-model='active_form_element.add_meta' type='checkbox' class='form-check-input' /> |
| 57 | - <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e( 'Show this field in receipts and emails?', 'invoicing' ); ?></label> |
|
| 57 | + <label class='form-check-label' :for="active_form_element.id + '_add_meta'"><?php esc_html_e('Show this field in receipts and emails?', 'invoicing'); ?></label> |
|
| 58 | 58 | </div> |
| 59 | 59 | |
| 60 | 60 | <hr class='featurette-divider mt-4'> |
| 61 | 61 | |
| 62 | 62 | <div class='form-group'> |
| 63 | 63 | <label class="d-block"> |
| 64 | - <span><?php esc_html_e( 'Email Merge Tag', 'invoicing' ); ?></span> |
|
| 64 | + <span><?php esc_html_e('Email Merge Tag', 'invoicing'); ?></span> |
|
| 65 | 65 | <input :value='active_form_element.label | formatMergeTag' class='form-control bg-white' type="text" readonly onclick="this.select()" /> |
| 66 | - <span class="form-text text-muted"><?php esc_html_e( 'You can use this merge tag in notification emails', 'invoicing' ); ?></span> |
|
| 66 | + <span class="form-text text-muted"><?php esc_html_e('You can use this merge tag in notification emails', 'invoicing'); ?></span> |
|
| 67 | 67 | </label> |
| 68 | 68 | </div> |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | |
@@ -31,45 +31,45 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | <div class='form-group'> |
| 33 | 33 | <label class="d-block"> |
| 34 | - <span><?php esc_html_e( 'Field Label', 'invoicing' ); ?></span> |
|
| 34 | + <span><?php esc_html_e('Field Label', 'invoicing'); ?></span> |
|
| 35 | 35 | <input v-model='field.label' class='form-control' type="text"/> |
| 36 | 36 | </label> |
| 37 | 37 | </div> |
| 38 | 38 | |
| 39 | 39 | <div class='form-group'> |
| 40 | 40 | <label class="d-block"> |
| 41 | - <span><?php esc_html_e( 'Placeholder text', 'invoicing' ); ?></span> |
|
| 41 | + <span><?php esc_html_e('Placeholder text', 'invoicing'); ?></span> |
|
| 42 | 42 | <input v-model='field.placeholder' class='form-control' type="text"/> |
| 43 | 43 | </label> |
| 44 | 44 | </div> |
| 45 | 45 | |
| 46 | 46 | <div class='form-group'> |
| 47 | 47 | <label class="d-block"> |
| 48 | - <span><?php esc_html_e( 'Width', 'invoicing' ); ?></span> |
|
| 48 | + <span><?php esc_html_e('Width', 'invoicing'); ?></span> |
|
| 49 | 49 | <select class='form-control custom-select' v-model='field.grid_width'> |
| 50 | - <option value='full'><?php esc_html_e( 'Full Width', 'invoicing' ); ?></option> |
|
| 51 | - <option value='half'><?php esc_html_e( 'Half Width', 'invoicing' ); ?></option> |
|
| 52 | - <option value='third'><?php esc_html_e( '1/3 Width', 'invoicing' ); ?></option> |
|
| 50 | + <option value='full'><?php esc_html_e('Full Width', 'invoicing'); ?></option> |
|
| 51 | + <option value='half'><?php esc_html_e('Half Width', 'invoicing'); ?></option> |
|
| 52 | + <option value='third'><?php esc_html_e('1/3 Width', 'invoicing'); ?></option> |
|
| 53 | 53 | </select> |
| 54 | 54 | </label> |
| 55 | 55 | </div> |
| 56 | 56 | |
| 57 | 57 | <div class='form-group'> |
| 58 | 58 | <label class="d-block"> |
| 59 | - <span><?php esc_html_e( 'Help Text', 'invoicing' ); ?></span> |
|
| 60 | - <textarea placeholder='<?php esc_attr_e( 'Add some help text for this field', 'invoicing' ); ?>' v-model='field.description' class='form-control' rows='3'></textarea> |
|
| 61 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
| 59 | + <span><?php esc_html_e('Help Text', 'invoicing'); ?></span> |
|
| 60 | + <textarea placeholder='<?php esc_attr_e('Add some help text for this field', 'invoicing'); ?>' v-model='field.description' class='form-control' rows='3'></textarea> |
|
| 61 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
| 62 | 62 | </label> |
| 63 | 63 | </div> |
| 64 | 64 | |
| 65 | 65 | <div class='form-group form-check'> |
| 66 | 66 | <input :id="active_form_element.id + '_edit_required' + index" v-model='field.required' type='checkbox' class='form-check-input' /> |
| 67 | - <label class='form-check-label' :for="active_form_element.id + '_edit_required' + index"><?php esc_html_e( 'Is required', 'invoicing' ); ?></label> |
|
| 67 | + <label class='form-check-label' :for="active_form_element.id + '_edit_required' + index"><?php esc_html_e('Is required', 'invoicing'); ?></label> |
|
| 68 | 68 | </div> |
| 69 | 69 | |
| 70 | 70 | <div class='form-group form-check'> |
| 71 | 71 | <input :id="active_form_element.id + '_edit_visible' + index" v-model='field.visible' type='checkbox' class='form-check-input' /> |
| 72 | - <label class='form-check-label' :for="active_form_element.id + '_edit_visible' + index"><?php esc_html_e( 'Is visible', 'invoicing' ); ?></label> |
|
| 72 | + <label class='form-check-label' :for="active_form_element.id + '_edit_visible' + index"><?php esc_html_e('Is visible', 'invoicing'); ?></label> |
|
| 73 | 73 | </div> |
| 74 | 74 | |
| 75 | 75 | </div> |
@@ -82,18 +82,18 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | <div class='form-group'> |
| 84 | 84 | <label class="d-block"> |
| 85 | - <span><?php esc_html_e( 'Address Type', 'invoicing' ); ?><span> |
|
| 85 | + <span><?php esc_html_e('Address Type', 'invoicing'); ?><span> |
|
| 86 | 86 | <select class='form-control custom-select' v-model='active_form_element.address_type'> |
| 87 | - <option value='billing'><?php esc_html_e( 'Billing', 'invoicing' ); ?></option> |
|
| 88 | - <option value='shipping'><?php esc_html_e( 'Shipping', 'invoicing' ); ?></option> |
|
| 89 | - <option value='both'><?php esc_html_e( 'Both', 'invoicing' ); ?></option> |
|
| 87 | + <option value='billing'><?php esc_html_e('Billing', 'invoicing'); ?></option> |
|
| 88 | + <option value='shipping'><?php esc_html_e('Shipping', 'invoicing'); ?></option> |
|
| 89 | + <option value='both'><?php esc_html_e('Both', 'invoicing'); ?></option> |
|
| 90 | 90 | </select> |
| 91 | 91 | </label> |
| 92 | 92 | </div> |
| 93 | 93 | |
| 94 | 94 | <div class='form-group' v-if="active_form_element.address_type == 'both'"> |
| 95 | 95 | <label class="d-block"> |
| 96 | - <span><?php esc_html_e( 'Shipping Address Toggle', 'invoicing' ); ?><span> |
|
| 96 | + <span><?php esc_html_e('Shipping Address Toggle', 'invoicing'); ?><span> |
|
| 97 | 97 | <input type="text" class='form-control custom-select' v-model='active_form_element.shipping_address_toggle' > |
| 98 | 98 | </label> |
| 99 | 99 | </div> |