@@ -7,14 +7,14 @@ |
||
| 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 v-if='!is_default'> |
| 15 | - <div class='alert alert-info' role='alert'><?php esc_html_e( 'Item totals will appear here. Click to set items.', 'invoicing' ); ?></div> |
|
| 15 | + <div class='alert alert-info' role='alert'><?php esc_html_e('Item totals will appear here. Click to set items.', 'invoicing'); ?></div> |
|
| 16 | 16 | </div> |
| 17 | 17 | |
| 18 | 18 | <div v-if='is_default'> |
| 19 | - <div class='alert alert-info' role='alert'><?php esc_html_e( 'Item totals will appear here.', 'invoicing' ); ?></div> |
|
| 19 | + <div class='alert alert-info' role='alert'><?php esc_html_e('Item totals will appear here.', 'invoicing'); ?></div> |
|
| 20 | 20 | </div> |
@@ -7,15 +7,15 @@ |
||
| 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 | <label><span v-html="form_element.label"></span></label> |
| 15 | 15 | <div class="d-flex w-100 flex-column align-items-center justify-content-center p-2" style="height: 200px; border: 3px dashed rgb(136, 136, 136); cursor: pointer;"> |
| 16 | 16 | <div class="h5 text-dark"> |
| 17 | - <span v-if="form_element.max_file_num > 1"><?php esc_html_e( 'Drag files to this area or click to upload', 'invoicing' ); ?></span> |
|
| 18 | - <span v-if="form_element.max_file_num < 2"><?php esc_html_e( 'Drag your file to this area or click to upload', 'invoicing' ); ?></span> |
|
| 17 | + <span v-if="form_element.max_file_num > 1"><?php esc_html_e('Drag files to this area or click to upload', 'invoicing'); ?></span> |
|
| 18 | + <span v-if="form_element.max_file_num < 2"><?php esc_html_e('Drag your file to this area or click to upload', 'invoicing'); ?></span> |
|
| 19 | 19 | </div> |
| 20 | 20 | <small v-if='form_element.description' class='form-text text-muted' v-html='form_element.description'></small> |
| 21 | 21 | </div> |
@@ -8,25 +8,25 @@ |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | 15 | <div class="getpaid-header-left-actions"> |
| 16 | 16 | |
| 17 | - <?php if ( $invoice->is_type( 'invoice' ) && $invoice->needs_payment() && ! $invoice->is_held() ) : ?> |
|
| 18 | - <a class="btn btn-sm btn-primary m-1 d-inline-block invoice-action-pay" href="<?php echo esc_url( $invoice->get_checkout_payment_url() ); ?>"> |
|
| 19 | - <?php esc_html_e( 'Pay For Invoice', 'invoicing' ); ?> |
|
| 17 | + <?php if ($invoice->is_type('invoice') && $invoice->needs_payment() && !$invoice->is_held()) : ?> |
|
| 18 | + <a class="btn btn-sm btn-primary m-1 d-inline-block invoice-action-pay" href="<?php echo esc_url($invoice->get_checkout_payment_url()); ?>"> |
|
| 19 | + <?php esc_html_e('Pay For Invoice', 'invoicing'); ?> |
|
| 20 | 20 | </a> |
| 21 | 21 | <?php endif; ?> |
| 22 | 22 | |
| 23 | - <?php if ( $invoice->is_type( 'invoice' ) && $invoice->is_paid() ) : ?> |
|
| 24 | - <a class="btn btn-sm btn-info m-1 d-inline-block invoice-action-receipt" href="<?php echo esc_url( $invoice->get_receipt_url() ); ?>"> |
|
| 25 | - <?php esc_html_e( 'View Receipt', 'invoicing' ); ?> |
|
| 23 | + <?php if ($invoice->is_type('invoice') && $invoice->is_paid()) : ?> |
|
| 24 | + <a class="btn btn-sm btn-info m-1 d-inline-block invoice-action-receipt" href="<?php echo esc_url($invoice->get_receipt_url()); ?>"> |
|
| 25 | + <?php esc_html_e('View Receipt', 'invoicing'); ?> |
|
| 26 | 26 | </a> |
| 27 | 27 | <?php endif; ?> |
| 28 | 28 | |
| 29 | - <?php do_action( 'wpinv_invoice_display_left_actions', $invoice ); ?> |
|
| 29 | + <?php do_action('wpinv_invoice_display_left_actions', $invoice); ?> |
|
| 30 | 30 | |
| 31 | 31 | </div> |
| 32 | 32 | |
@@ -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-" . esc_attr( $class ) . "'>"; |
|
| 16 | + $class = sanitize_html_class( $column ); |
|
| 17 | + echo "<td class='getpaid-subscriptions-table-column-" . esc_attr( $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 wp_kses_post( $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 wp_kses_post( $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 wp_kses_post( $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 wp_kses_post( $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 ); |
|
| 17 | - echo "<td class='getpaid-subscriptions-table-column-" . esc_attr( $class ) . "'>"; |
|
| 16 | + $class = sanitize_html_class($column); |
|
| 17 | + echo "<td class='getpaid-subscriptions-table-column-" . esc_attr($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 wp_kses_post( $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ) ); |
|
| 30 | + echo wp_kses_post($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 | |
@@ -4,68 +4,68 @@ |
||
| 4 | 4 | * |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | -defined( 'ABSPATH' ) || exit; |
|
| 7 | +defined('ABSPATH') || exit; |
|
| 8 | 8 | |
| 9 | 9 | ?> |
| 10 | 10 | |
| 11 | 11 | <div class="card shadow-sm my-5"> |
| 12 | 12 | <div class="text-center card-body"> |
| 13 | - <h1 class="h3"><?php esc_html_e( 'Awesome, you are ready to Get Paid', 'invoicing' ); ?></h1> |
|
| 13 | + <h1 class="h3"><?php esc_html_e('Awesome, you are ready to Get Paid', 'invoicing'); ?></h1> |
|
| 14 | 14 | |
| 15 | 15 | <div class="geodirectory-message geodirectory-tracker"> |
| 16 | - <p><?php esc_html_e( 'Thank you for choosing GetPaid!', 'invoicing' ); ?> <i class="far fa-smile-beam"></i></p> |
|
| 16 | + <p><?php esc_html_e('Thank you for choosing GetPaid!', 'invoicing'); ?> <i class="far fa-smile-beam"></i></p> |
|
| 17 | 17 | </div> |
| 18 | 18 | |
| 19 | 19 | <div class="gp-setup-next-steps"> |
| 20 | 20 | <div class="gp-setup-next-steps-first mb-4"> |
| 21 | 21 | <div> |
| 22 | - <h2 class="h3"><i class="fas fa-arrow-down"></i> <?php esc_html_e( 'Watch This', 'invoicing' ); ?> <i class="fas fa-arrow-down"></i></h2> |
|
| 22 | + <h2 class="h3"><i class="fas fa-arrow-down"></i> <?php esc_html_e('Watch This', 'invoicing'); ?> <i class="fas fa-arrow-down"></i></h2> |
|
| 23 | 23 | <div class="embed-responsive embed-responsive-16by9 mb-4"> |
| 24 | 24 | <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/TXZuPXHjt9E?rel=0" allowfullscreen></iframe> |
| 25 | 25 | </div> |
| 26 | 26 | </div> |
| 27 | - <h2 class="h3"><?php esc_html_e( 'Next steps', 'invoicing' ); ?></h2> |
|
| 27 | + <h2 class="h3"><?php esc_html_e('Next steps', 'invoicing'); ?></h2> |
|
| 28 | 28 | |
| 29 | 29 | <div class="d-flex justify-content-between"> |
| 30 | 30 | <a |
| 31 | 31 | class="btn btn-outline-primary btn-sm" |
| 32 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_item' ) ); ?>"> |
|
| 32 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_item')); ?>"> |
|
| 33 | 33 | <span class="h1 d-block"><i class="fas fa-box-open"></i></span> |
| 34 | - <?php esc_html_e( 'Create Item', 'invoicing' ); ?> |
|
| 34 | + <?php esc_html_e('Create Item', 'invoicing'); ?> |
|
| 35 | 35 | </a> |
| 36 | 36 | <a |
| 37 | 37 | class="btn btn-outline-primary btn-sm" |
| 38 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_payment_form' ) ); ?>"> |
|
| 38 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_payment_form')); ?>"> |
|
| 39 | 39 | <span class="h1 d-block"><i class="fas fa-align-justify"></i></span> |
| 40 | - <?php esc_html_e( 'Create Payment Form', 'invoicing' ); ?> |
|
| 40 | + <?php esc_html_e('Create Payment Form', 'invoicing'); ?> |
|
| 41 | 41 | </a> |
| 42 | 42 | <a |
| 43 | 43 | class="btn btn-outline-primary btn-sm" |
| 44 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=wpi_invoice' ) ); ?>"> |
|
| 44 | + href="<?php echo esc_url(admin_url('post-new.php?post_type=wpi_invoice')); ?>"> |
|
| 45 | 45 | <span class="h1 d-block"><i class="fas fa-file-alt"></i></span> |
| 46 | - <?php esc_html_e( 'Create Invoice', 'invoicing' ); ?> |
|
| 46 | + <?php esc_html_e('Create Invoice', 'invoicing'); ?> |
|
| 47 | 47 | </a> |
| 48 | 48 | </div> |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | |
| 52 | - <h2 class="h3 mt-4"><?php esc_html_e( 'Learn more', 'invoicing' ); ?></h2> |
|
| 52 | + <h2 class="h3 mt-4"><?php esc_html_e('Learn more', 'invoicing'); ?></h2> |
|
| 53 | 53 | <div class="gp-setup-next-steps-last mt-2 d-flex justify-content-between"> |
| 54 | 54 | <a |
| 55 | 55 | class="btn btn-outline-primary btn-sm" href="https://docs.wpgetpaid.com/collection/114-getting-started?utm_source=setupwizard&utm_medium=product&utm_content=getting-started&utm_campaign=invoicingplugin" |
| 56 | - target="_blank"><?php esc_html_e( 'Getting Started', 'invoicing' ); ?></a> |
|
| 56 | + target="_blank"><?php esc_html_e('Getting Started', 'invoicing'); ?></a> |
|
| 57 | 57 | <a |
| 58 | 58 | class="btn btn-outline-primary btn-sm" |
| 59 | 59 | href="https://docs.wpgetpaid.com/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=invoicingplugin" |
| 60 | - target="_blank"><?php esc_html_e( 'Documentation', 'invoicing' ); ?></a> |
|
| 60 | + target="_blank"><?php esc_html_e('Documentation', 'invoicing'); ?></a> |
|
| 61 | 61 | <a |
| 62 | 62 | class="btn btn-outline-primary btn-sm" |
| 63 | 63 | href="https://wpgetpaid.com/support/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=invoicingyplugin" |
| 64 | - target="_blank"><?php esc_html_e( 'Support', 'invoicing' ); ?></a> |
|
| 64 | + target="_blank"><?php esc_html_e('Support', 'invoicing'); ?></a> |
|
| 65 | 65 | <a |
| 66 | 66 | class="btn btn-outline-primary btn-sm" |
| 67 | 67 | href="https://demos.ayecode.io/getpaid/?utm_source=setupwizard&utm_medium=product&utm_content=demos&utm_campaign=invoicingyplugin" |
| 68 | - target="_blank"><?php esc_html_e( 'Demos', 'invoicing' ); ?></a> |
|
| 68 | + target="_blank"><?php esc_html_e('Demos', 'invoicing'); ?></a> |
|
| 69 | 69 | </div> |
| 70 | 70 | </div> |
| 71 | 71 | </div> |
@@ -4,78 +4,78 @@ discard block |
||
| 4 | 4 | * |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | -defined( 'ABSPATH' ) || exit; |
|
| 7 | +defined('ABSPATH') || exit; |
|
| 8 | 8 | |
| 9 | 9 | ?> |
| 10 | 10 | |
| 11 | 11 | <div class="card shadow-sm my-5"> |
| 12 | 12 | |
| 13 | 13 | <h1 class="h4 card-header bg-white border-bottom-0 pt-4 pb-1"> |
| 14 | - <?php esc_html_e( 'Welcome to the GetPaid Setup Wizard!', 'invoicing' ); ?> |
|
| 14 | + <?php esc_html_e('Welcome to the GetPaid Setup Wizard!', 'invoicing'); ?> |
|
| 15 | 15 | </h1> |
| 16 | 16 | |
| 17 | 17 | <div class="card-body text-muted "> |
| 18 | - <p><?php esc_html_e( 'Thank you for choosing GetPaid - The most Powerful Payments Plugin for WordPress', 'invoicing' ); ?></p> |
|
| 18 | + <p><?php esc_html_e('Thank you for choosing GetPaid - The most Powerful Payments Plugin for WordPress', 'invoicing'); ?></p> |
|
| 19 | 19 | <hr class="mt-4 pt-3 pb-0" /> |
| 20 | - <p class="small"><?php echo wp_kses_post( __( 'This quick setup wizard will help you <b>configure the basic settings</b>. It’s <b>completely optional</b> and shouldn’t take longer than <b>five minutes</b>.', 'invoicing' ) ); ?></p> |
|
| 20 | + <p class="small"><?php echo wp_kses_post(__('This quick setup wizard will help you <b>configure the basic settings</b>. It’s <b>completely optional</b> and shouldn’t take longer than <b>five minutes</b>.', 'invoicing')); ?></p> |
|
| 21 | 21 | </div> |
| 22 | 22 | |
| 23 | 23 | <div class="card-footer mb-0 bg-white gp-setup-actions step border-top-0"> |
| 24 | 24 | <a |
| 25 | - href="<?php echo esc_url( $next_url ); ?>" |
|
| 26 | - class="btn btn-primary button-next"><?php esc_html_e( "Let's go!", 'invoicing' ); ?></a> |
|
| 25 | + href="<?php echo esc_url($next_url); ?>" |
|
| 26 | + class="btn btn-primary button-next"><?php esc_html_e("Let's go!", 'invoicing'); ?></a> |
|
| 27 | 27 | <a |
| 28 | - href="<?php echo esc_url( admin_url() ); ?>" |
|
| 29 | - class="btn btn-link d-block mt-2 "><?php esc_html_e( 'Not right now', 'invoicing' ); ?></a> |
|
| 28 | + href="<?php echo esc_url(admin_url()); ?>" |
|
| 29 | + class="btn btn-link d-block mt-2 "><?php esc_html_e('Not right now', 'invoicing'); ?></a> |
|
| 30 | 30 | </div> |
| 31 | 31 | </div> |
| 32 | 32 | |
| 33 | 33 | <div class="card shadow-sm my-5 overflow-hidden"> |
| 34 | 34 | <h1 class="h4 card-header bg-white border-bottom-0 pt-4 pb-1"> |
| 35 | - <?php esc_html_e( 'GetPaid Features & Addons!', 'invoicing' ); ?> |
|
| 35 | + <?php esc_html_e('GetPaid Features & Addons!', 'invoicing'); ?> |
|
| 36 | 36 | </h1> |
| 37 | 37 | |
| 38 | 38 | <div class="card-body text-muted overflow-hidden"> |
| 39 | - <p><?php esc_html_e( 'Collect one time & recurring payments online within minutes. No complex setup required.', 'invoicing' ); ?></p> |
|
| 39 | + <p><?php esc_html_e('Collect one time & recurring payments online within minutes. No complex setup required.', 'invoicing'); ?></p> |
|
| 40 | 40 | <hr> |
| 41 | 41 | |
| 42 | 42 | <div class="row row-cols-2 text-left"> |
| 43 | 43 | <div class="col mt-3"> |
| 44 | 44 | <div class="media"> |
| 45 | - <img src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/buy.svg' ); ?>" class="mr-3" alt="..."> |
|
| 45 | + <img src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/buy.svg'); ?>" class="mr-3" alt="..."> |
|
| 46 | 46 | <div class="media-body"> |
| 47 | - <h6 class="mt-0 font-weight-bold"><?php esc_html_e( 'GetPaid via Buy Now Buttons', 'invoicing' ); ?></h6> |
|
| 48 | - <small><?php esc_html_e( 'Sell via buy now buttons anywhere on your site', 'invoicing' ); ?></small> |
|
| 47 | + <h6 class="mt-0 font-weight-bold"><?php esc_html_e('GetPaid via Buy Now Buttons', 'invoicing'); ?></h6> |
|
| 48 | + <small><?php esc_html_e('Sell via buy now buttons anywhere on your site', 'invoicing'); ?></small> |
|
| 49 | 49 | </div> |
| 50 | 50 | </div> |
| 51 | 51 | </div> |
| 52 | 52 | |
| 53 | 53 | <div class="col mt-3"> |
| 54 | 54 | <div class="media"> |
| 55 | - <img src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/report.svg' ); ?>" class="mr-3" alt="..."> |
|
| 55 | + <img src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/report.svg'); ?>" class="mr-3" alt="..."> |
|
| 56 | 56 | <div class="media-body"> |
| 57 | - <h6 class="mt-0 font-weight-bold"><?php esc_html_e( 'GetPaid via payment form', 'invoicing' ); ?></h6> |
|
| 58 | - <small><?php esc_html_e( 'Payment forms are conversion-optimized checkout forms', 'invoicing' ); ?></small> |
|
| 57 | + <h6 class="mt-0 font-weight-bold"><?php esc_html_e('GetPaid via payment form', 'invoicing'); ?></h6> |
|
| 58 | + <small><?php esc_html_e('Payment forms are conversion-optimized checkout forms', 'invoicing'); ?></small> |
|
| 59 | 59 | </div> |
| 60 | 60 | </div> |
| 61 | 61 | </div> |
| 62 | 62 | |
| 63 | 63 | <div class="col mt-3"> |
| 64 | 64 | <div class="media"> |
| 65 | - <img src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/invoices.svg' ); ?>" class="mr-3" alt="..."> |
|
| 65 | + <img src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/invoices.svg'); ?>" class="mr-3" alt="..."> |
|
| 66 | 66 | <div class="media-body"> |
| 67 | - <h6 class="mt-0 font-weight-bold"><?php esc_html_e( 'GetPaid via Invoice', 'invoicing' ); ?></h6> |
|
| 68 | - <small><?php esc_html_e( 'Create and send invoices for just about anything from the WordPress dashboard', 'invoicing' ); ?></small> |
|
| 67 | + <h6 class="mt-0 font-weight-bold"><?php esc_html_e('GetPaid via Invoice', 'invoicing'); ?></h6> |
|
| 68 | + <small><?php esc_html_e('Create and send invoices for just about anything from the WordPress dashboard', 'invoicing'); ?></small> |
|
| 69 | 69 | </div> |
| 70 | 70 | </div> |
| 71 | 71 | </div> |
| 72 | 72 | |
| 73 | 73 | <div class="col mt-3"> |
| 74 | 74 | <div class="media"> |
| 75 | - <img src="<?php echo esc_url( WPINV_PLUGIN_URL . 'assets/images/payment.svg' ); ?>" class="mr-3" alt="..."> |
|
| 75 | + <img src="<?php echo esc_url(WPINV_PLUGIN_URL . 'assets/images/payment.svg'); ?>" class="mr-3" alt="..."> |
|
| 76 | 76 | <div class="media-body"> |
| 77 | - <h6 class="mt-0 font-weight-bold"><?php esc_html_e( 'Affordable payment gateways', 'invoicing' ); ?></h6> |
|
| 78 | - <small><?php esc_html_e( 'On average our gateways are over 66% cheaper than our competition', 'invoicing' ); ?></small> |
|
| 77 | + <h6 class="mt-0 font-weight-bold"><?php esc_html_e('Affordable payment gateways', 'invoicing'); ?></h6> |
|
| 78 | + <small><?php esc_html_e('On average our gateways are over 66% cheaper than our competition', 'invoicing'); ?></small> |
|
| 79 | 79 | </div> |
| 80 | 80 | </div> |
| 81 | 81 | </div> |
@@ -86,51 +86,51 @@ discard block |
||
| 86 | 86 | <div class="mt-5"> |
| 87 | 87 | <a |
| 88 | 88 | href="https://wpgetpaid.com/features-list/" |
| 89 | - class="btn btn-primary"><?php esc_html_e( 'View All Features!', 'invoicing' ); ?></a> |
|
| 89 | + class="btn btn-primary"><?php esc_html_e('View All Features!', 'invoicing'); ?></a> |
|
| 90 | 90 | </div> |
| 91 | 91 | |
| 92 | 92 | <div class="mt-5 mx-n4 py-4" style="background:#eafaf6;"> |
| 93 | - <h4 class="mt-0 font-weight-bold text-dark mb-4"><?php esc_html_e( 'More with Membership!', 'invoicing' ); ?></h4> |
|
| 93 | + <h4 class="mt-0 font-weight-bold text-dark mb-4"><?php esc_html_e('More with Membership!', 'invoicing'); ?></h4> |
|
| 94 | 94 | <div class="row row-cols-2 text-left px-5"> |
| 95 | 95 | |
| 96 | 96 | <div class="col"> |
| 97 | 97 | <ul class="list-unstyled"> |
| 98 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'PDF Invoices', 'invoicing' ); ?></li> |
|
| 99 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'Gravity Forms', 'invoicing' ); ?></li> |
|
| 100 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'Contact form 7', 'invoicing' ); ?></li> |
|
| 101 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'AffiliateWP Integration', 'invoicing' ); ?></li> |
|
| 98 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('PDF Invoices', 'invoicing'); ?></li> |
|
| 99 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('Gravity Forms', 'invoicing'); ?></li> |
|
| 100 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('Contact form 7', 'invoicing'); ?></li> |
|
| 101 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('AffiliateWP Integration', 'invoicing'); ?></li> |
|
| 102 | 102 | </ul> |
| 103 | 103 | </div> |
| 104 | 104 | |
| 105 | 105 | <div class="col"> |
| 106 | 106 | <ul class="list-unstyled"> |
| 107 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'Ninja forms', 'invoicing' ); ?></li> |
|
| 108 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'Digital Downloads', 'invoicing' ); ?></li> |
|
| 109 | - <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e( 'Wallet', 'invoicing' ); ?></li> |
|
| 107 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('Ninja forms', 'invoicing'); ?></li> |
|
| 108 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('Digital Downloads', 'invoicing'); ?></li> |
|
| 109 | + <li class="my-2"><i class="far fa-check-circle text-success"></i> <?php esc_html_e('Wallet', 'invoicing'); ?></li> |
|
| 110 | 110 | </ul> |
| 111 | 111 | </div> |
| 112 | 112 | </div> |
| 113 | 113 | |
| 114 | - <h5 class="mt-4 font-weight-bold text-dark mb-3"><?php esc_html_e( 'Membership Starts From', 'invoicing' ); ?></h5> |
|
| 115 | - <h1 class="mt-0 font-weight-bold text-dark mb-4 display-3"><?php esc_html_e( '$49', 'invoicing' ); ?></h1> |
|
| 114 | + <h5 class="mt-4 font-weight-bold text-dark mb-3"><?php esc_html_e('Membership Starts From', 'invoicing'); ?></h5> |
|
| 115 | + <h1 class="mt-0 font-weight-bold text-dark mb-4 display-3"><?php esc_html_e('$49', 'invoicing'); ?></h1> |
|
| 116 | 116 | |
| 117 | 117 | <div class="mt-2"> |
| 118 | 118 | <a |
| 119 | 119 | href="https://wpgetpaid.com/downloads/membership/" |
| 120 | - class="btn btn-primary"><?php esc_html_e( 'Buy Membership Now!', 'invoicing' ); ?></a> |
|
| 120 | + class="btn btn-primary"><?php esc_html_e('Buy Membership Now!', 'invoicing'); ?></a> |
|
| 121 | 121 | </div> |
| 122 | 122 | |
| 123 | 123 | </div> |
| 124 | 124 | |
| 125 | 125 | <div class="card-footer mb-0 bg-white gp-setup-actions step border-top-0"> |
| 126 | 126 | <a |
| 127 | - href="<?php echo esc_url( $next_url ); ?>" |
|
| 128 | - class="btn btn-outline-primary button-next"><?php esc_html_e( 'Launch the Setup Wizard!', 'invoicing' ); ?></a> |
|
| 127 | + href="<?php echo esc_url($next_url); ?>" |
|
| 128 | + class="btn btn-outline-primary button-next"><?php esc_html_e('Launch the Setup Wizard!', 'invoicing'); ?></a> |
|
| 129 | 129 | <a |
| 130 | 130 | href="https://docs.wpgetpaid.com/" |
| 131 | - class="btn btn-outline-primary ml-4"><?php esc_html_e( 'Documentation', 'invoicing' ); ?></a> |
|
| 131 | + class="btn btn-outline-primary ml-4"><?php esc_html_e('Documentation', 'invoicing'); ?></a> |
|
| 132 | 132 | <a |
| 133 | - href="<?php echo esc_url( admin_url() ); ?>" |
|
| 134 | - class="btn btn-link d-block mt-2 "><?php esc_html_e( 'Not right now', 'invoicing' ); ?></a> |
|
| 133 | + href="<?php echo esc_url(admin_url()); ?>" |
|
| 134 | + class="btn btn-link d-block mt-2 "><?php esc_html_e('Not right now', 'invoicing'); ?></a> |
|
| 135 | 135 | </div> |
| 136 | 136 | </div> |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | +if (!defined('ABSPATH')) { |
|
| 4 | 4 | exit; // Exit if accessed directly |
| 5 | 5 | } |
| 6 | 6 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @return AUI|null |
| 36 | 36 | */ |
| 37 | 37 | public static function instance() { |
| 38 | - if ( self::$instance == null ) { |
|
| 38 | + if (self::$instance == null) { |
|
| 39 | 39 | self::$instance = new AUI(); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | * @since 1.0.0 |
| 49 | 49 | */ |
| 50 | 50 | private function __construct() { |
| 51 | - if ( function_exists( "__autoload" ) ) { |
|
| 52 | - spl_autoload_register( "__autoload" ); |
|
| 51 | + if (function_exists("__autoload")) { |
|
| 52 | + spl_autoload_register("__autoload"); |
|
| 53 | 53 | } |
| 54 | - spl_autoload_register( array( $this, 'autoload' ) ); |
|
| 54 | + spl_autoload_register(array($this, 'autoload')); |
|
| 55 | 55 | |
| 56 | 56 | // load options |
| 57 | 57 | self::$options = get_option('aui_options'); |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @param $classname |
| 66 | 66 | */ |
| 67 | - private function autoload( $classname ) { |
|
| 68 | - $class = str_replace( '_', '-', strtolower( $classname ) ); |
|
| 69 | - $file_path = trailingslashit( dirname( __FILE__ ) ) . "components/class-" . $class . '.php'; |
|
| 70 | - if ( $file_path && is_readable( $file_path ) ) { |
|
| 71 | - include_once( $file_path ); |
|
| 67 | + private function autoload($classname) { |
|
| 68 | + $class = str_replace('_', '-', strtolower($classname)); |
|
| 69 | + $file_path = trailingslashit(dirname(__FILE__)) . "components/class-" . $class . '.php'; |
|
| 70 | + if ($file_path && is_readable($file_path)) { |
|
| 71 | + include_once($file_path); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
@@ -79,34 +79,34 @@ discard block |
||
| 79 | 79 | * |
| 80 | 80 | * @return string|void |
| 81 | 81 | */ |
| 82 | - public function get_option( $option ){ |
|
| 82 | + public function get_option($option) { |
|
| 83 | 83 | $result = isset(self::$options[$option]) ? esc_attr(self::$options[$option]) : ''; |
| 84 | 84 | |
| 85 | - if ( ! $result && $option) { |
|
| 86 | - if( $option == 'color_primary' ){ |
|
| 85 | + if (!$result && $option) { |
|
| 86 | + if ($option == 'color_primary') { |
|
| 87 | 87 | $result = AUI_PRIMARY_COLOR; |
| 88 | - }elseif( $option == 'color_secondary' ){ |
|
| 88 | + }elseif ($option == 'color_secondary') { |
|
| 89 | 89 | $result = AUI_SECONDARY_COLOR; |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | return $result; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function render( $items = array(), $echo = false ) { |
|
| 95 | + public function render($items = array(), $echo = false) { |
|
| 96 | 96 | $output = ''; |
| 97 | 97 | |
| 98 | - if ( ! empty( $items ) ) { |
|
| 99 | - foreach ( $items as $args ) { |
|
| 100 | - $render = isset( $args['render'] ) ? $args['render'] : ''; |
|
| 101 | - if ( $render && method_exists( __CLASS__, $render ) ) { |
|
| 102 | - $output .= $this->$render( $args ); |
|
| 98 | + if (!empty($items)) { |
|
| 99 | + foreach ($items as $args) { |
|
| 100 | + $render = isset($args['render']) ? $args['render'] : ''; |
|
| 101 | + if ($render && method_exists(__CLASS__, $render)) { |
|
| 102 | + $output .= $this->$render($args); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if ( $echo ) { |
|
| 107 | + if ($echo) { |
|
| 108 | 108 | echo $output; |
| 109 | - }else{ |
|
| 109 | + } else { |
|
| 110 | 110 | return $output; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -122,12 +122,12 @@ discard block |
||
| 122 | 122 | * |
| 123 | 123 | * @return string The rendered component. |
| 124 | 124 | */ |
| 125 | - public function alert( $args = array(), $echo = false ) { |
|
| 126 | - $output = AUI_Component_Alert::get( $args ); |
|
| 125 | + public function alert($args = array(), $echo = false) { |
|
| 126 | + $output = AUI_Component_Alert::get($args); |
|
| 127 | 127 | |
| 128 | - if ( $echo ) { |
|
| 128 | + if ($echo) { |
|
| 129 | 129 | echo $output; |
| 130 | - }else{ |
|
| 130 | + } else { |
|
| 131 | 131 | return $output; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -142,12 +142,12 @@ discard block |
||
| 142 | 142 | * |
| 143 | 143 | * @return string The rendered component. |
| 144 | 144 | */ |
| 145 | - public function input( $args = array(), $echo = false ) { |
|
| 146 | - $output = AUI_Component_Input::input( $args ); |
|
| 145 | + public function input($args = array(), $echo = false) { |
|
| 146 | + $output = AUI_Component_Input::input($args); |
|
| 147 | 147 | |
| 148 | - if ( $echo ) { |
|
| 148 | + if ($echo) { |
|
| 149 | 149 | echo $output; |
| 150 | - }else{ |
|
| 150 | + } else { |
|
| 151 | 151 | return $output; |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -162,12 +162,12 @@ discard block |
||
| 162 | 162 | * |
| 163 | 163 | * @return string The rendered component. |
| 164 | 164 | */ |
| 165 | - public function textarea( $args = array(), $echo = false ) { |
|
| 166 | - $output = AUI_Component_Input::textarea( $args ); |
|
| 165 | + public function textarea($args = array(), $echo = false) { |
|
| 166 | + $output = AUI_Component_Input::textarea($args); |
|
| 167 | 167 | |
| 168 | - if ( $echo ) { |
|
| 168 | + if ($echo) { |
|
| 169 | 169 | echo $output; |
| 170 | - }else{ |
|
| 170 | + } else { |
|
| 171 | 171 | return $output; |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | * |
| 183 | 183 | * @return string The rendered component. |
| 184 | 184 | */ |
| 185 | - public function button( $args = array(), $echo = false ) { |
|
| 186 | - $output = AUI_Component_Button::get( $args ); |
|
| 185 | + public function button($args = array(), $echo = false) { |
|
| 186 | + $output = AUI_Component_Button::get($args); |
|
| 187 | 187 | |
| 188 | - if ( $echo ) { |
|
| 188 | + if ($echo) { |
|
| 189 | 189 | echo $output; |
| 190 | - }else{ |
|
| 190 | + } else { |
|
| 191 | 191 | return $output; |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -202,26 +202,26 @@ discard block |
||
| 202 | 202 | * |
| 203 | 203 | * @return string The rendered component. |
| 204 | 204 | */ |
| 205 | - public function badge( $args = array(), $echo = false ) { |
|
| 205 | + public function badge($args = array(), $echo = false) { |
|
| 206 | 206 | $defaults = array( |
| 207 | 207 | 'class' => 'badge badge-primary align-middle', |
| 208 | 208 | ); |
| 209 | 209 | |
| 210 | 210 | // maybe set type. |
| 211 | - if ( empty( $args['href'] ) ) { |
|
| 211 | + if (empty($args['href'])) { |
|
| 212 | 212 | $defaults['type'] = 'badge'; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | 216 | * Parse incoming $args into an array and merge it with $defaults |
| 217 | 217 | */ |
| 218 | - $args = wp_parse_args( $args, $defaults ); |
|
| 218 | + $args = wp_parse_args($args, $defaults); |
|
| 219 | 219 | |
| 220 | - $output = AUI_Component_Button::get( $args ); |
|
| 220 | + $output = AUI_Component_Button::get($args); |
|
| 221 | 221 | |
| 222 | - if ( $echo ) { |
|
| 222 | + if ($echo) { |
|
| 223 | 223 | echo $output; |
| 224 | - }else{ |
|
| 224 | + } else { |
|
| 225 | 225 | return $output; |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -236,12 +236,12 @@ discard block |
||
| 236 | 236 | * |
| 237 | 237 | * @return string The rendered component. |
| 238 | 238 | */ |
| 239 | - public function dropdown( $args = array(), $echo = false ) { |
|
| 240 | - $output = AUI_Component_Dropdown::get( $args ); |
|
| 239 | + public function dropdown($args = array(), $echo = false) { |
|
| 240 | + $output = AUI_Component_Dropdown::get($args); |
|
| 241 | 241 | |
| 242 | - if ( $echo ) { |
|
| 242 | + if ($echo) { |
|
| 243 | 243 | echo $output; |
| 244 | - }else{ |
|
| 244 | + } else { |
|
| 245 | 245 | return $output; |
| 246 | 246 | } |
| 247 | 247 | } |
@@ -256,12 +256,12 @@ discard block |
||
| 256 | 256 | * |
| 257 | 257 | * @return string The rendered component. |
| 258 | 258 | */ |
| 259 | - public function select( $args = array(), $echo = false ) { |
|
| 260 | - $output = AUI_Component_Input::select( $args ); |
|
| 259 | + public function select($args = array(), $echo = false) { |
|
| 260 | + $output = AUI_Component_Input::select($args); |
|
| 261 | 261 | |
| 262 | - if ( $echo ) { |
|
| 262 | + if ($echo) { |
|
| 263 | 263 | echo $output; |
| 264 | - }else{ |
|
| 264 | + } else { |
|
| 265 | 265 | return $output; |
| 266 | 266 | } |
| 267 | 267 | } |
@@ -276,12 +276,12 @@ discard block |
||
| 276 | 276 | * |
| 277 | 277 | * @return string The rendered component. |
| 278 | 278 | */ |
| 279 | - public function radio( $args = array(), $echo = false ) { |
|
| 280 | - $output = AUI_Component_Input::radio( $args ); |
|
| 279 | + public function radio($args = array(), $echo = false) { |
|
| 280 | + $output = AUI_Component_Input::radio($args); |
|
| 281 | 281 | |
| 282 | - if ( $echo ) { |
|
| 282 | + if ($echo) { |
|
| 283 | 283 | echo $output; |
| 284 | - }else{ |
|
| 284 | + } else { |
|
| 285 | 285 | return $output; |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -296,12 +296,12 @@ discard block |
||
| 296 | 296 | * |
| 297 | 297 | * @return string The rendered component. |
| 298 | 298 | */ |
| 299 | - public function pagination( $args = array(), $echo = false ) { |
|
| 300 | - $output = AUI_Component_Pagination::get( $args ); |
|
| 299 | + public function pagination($args = array(), $echo = false) { |
|
| 300 | + $output = AUI_Component_Pagination::get($args); |
|
| 301 | 301 | |
| 302 | - if ( $echo ) { |
|
| 302 | + if ($echo) { |
|
| 303 | 303 | echo $output; |
| 304 | - }else{ |
|
| 304 | + } else { |
|
| 305 | 305 | return $output; |
| 306 | 306 | } |
| 307 | 307 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | if ( ! $result && $option) { |
| 86 | 86 | if( $option == 'color_primary' ){ |
| 87 | 87 | $result = AUI_PRIMARY_COLOR; |
| 88 | - }elseif( $option == 'color_secondary' ){ |
|
| 88 | + } elseif( $option == 'color_secondary' ){ |
|
| 89 | 89 | $result = AUI_SECONDARY_COLOR; |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | if ( $echo ) { |
| 108 | 108 | echo $output; |
| 109 | - }else{ |
|
| 109 | + } else{ |
|
| 110 | 110 | return $output; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | if ( $echo ) { |
| 129 | 129 | echo $output; |
| 130 | - }else{ |
|
| 130 | + } else{ |
|
| 131 | 131 | return $output; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | if ( $echo ) { |
| 149 | 149 | echo $output; |
| 150 | - }else{ |
|
| 150 | + } else{ |
|
| 151 | 151 | return $output; |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | if ( $echo ) { |
| 169 | 169 | echo $output; |
| 170 | - }else{ |
|
| 170 | + } else{ |
|
| 171 | 171 | return $output; |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | if ( $echo ) { |
| 189 | 189 | echo $output; |
| 190 | - }else{ |
|
| 190 | + } else{ |
|
| 191 | 191 | return $output; |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | if ( $echo ) { |
| 223 | 223 | echo $output; |
| 224 | - }else{ |
|
| 224 | + } else{ |
|
| 225 | 225 | return $output; |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | if ( $echo ) { |
| 243 | 243 | echo $output; |
| 244 | - }else{ |
|
| 244 | + } else{ |
|
| 245 | 245 | return $output; |
| 246 | 246 | } |
| 247 | 247 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | if ( $echo ) { |
| 263 | 263 | echo $output; |
| 264 | - }else{ |
|
| 264 | + } else{ |
|
| 265 | 265 | return $output; |
| 266 | 266 | } |
| 267 | 267 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | if ( $echo ) { |
| 283 | 283 | echo $output; |
| 284 | - }else{ |
|
| 284 | + } else{ |
|
| 285 | 285 | return $output; |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | if ( $echo ) { |
| 303 | 303 | echo $output; |
| 304 | - }else{ |
|
| 304 | + } else{ |
|
| 305 | 305 | return $output; |
| 306 | 306 | } |
| 307 | 307 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | - exit; // Exit if accessed directly |
|
| 4 | + exit; // Exit if accessed directly |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | /** |
@@ -11,299 +11,299 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | class AUI { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Holds the class instance. |
|
| 16 | - * |
|
| 17 | - * @since 1.0.0 |
|
| 18 | - * @var null |
|
| 19 | - */ |
|
| 20 | - private static $instance = null; |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * Holds the current AUI version number. |
|
| 24 | - * |
|
| 25 | - * @var string $ver The current version number. |
|
| 26 | - */ |
|
| 27 | - public static $ver = '0.1.72'; |
|
| 28 | - |
|
| 29 | - public static $options = null; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * There can be only one. |
|
| 33 | - * |
|
| 34 | - * @since 1.0.0 |
|
| 35 | - * @return AUI|null |
|
| 36 | - */ |
|
| 37 | - public static function instance() { |
|
| 38 | - if ( self::$instance == null ) { |
|
| 39 | - self::$instance = new AUI(); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - return self::$instance; |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * AUI constructor. |
|
| 47 | - * |
|
| 48 | - * @since 1.0.0 |
|
| 49 | - */ |
|
| 50 | - private function __construct() { |
|
| 51 | - if ( function_exists( "__autoload" ) ) { |
|
| 52 | - spl_autoload_register( "__autoload" ); |
|
| 53 | - } |
|
| 54 | - spl_autoload_register( array( $this, 'autoload' ) ); |
|
| 55 | - |
|
| 56 | - // load options |
|
| 57 | - self::$options = get_option('aui_options'); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Autoload any components on the fly. |
|
| 62 | - * |
|
| 63 | - * @since 1.0.0 |
|
| 64 | - * |
|
| 65 | - * @param $classname |
|
| 66 | - */ |
|
| 67 | - private function autoload( $classname ) { |
|
| 68 | - $class = str_replace( '_', '-', strtolower( $classname ) ); |
|
| 69 | - $file_path = trailingslashit( dirname( __FILE__ ) ) . "components/class-" . $class . '.php'; |
|
| 70 | - if ( $file_path && is_readable( $file_path ) ) { |
|
| 71 | - include_once( $file_path ); |
|
| 72 | - } |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * Get the AUI options. |
|
| 77 | - * |
|
| 78 | - * @param $option |
|
| 79 | - * |
|
| 80 | - * @return string|void |
|
| 81 | - */ |
|
| 82 | - public function get_option( $option ){ |
|
| 83 | - $result = isset(self::$options[$option]) ? esc_attr(self::$options[$option]) : ''; |
|
| 84 | - |
|
| 85 | - if ( ! $result && $option) { |
|
| 86 | - if( $option == 'color_primary' ){ |
|
| 87 | - $result = AUI_PRIMARY_COLOR; |
|
| 88 | - }elseif( $option == 'color_secondary' ){ |
|
| 89 | - $result = AUI_SECONDARY_COLOR; |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - return $result; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - public function render( $items = array(), $echo = false ) { |
|
| 96 | - $output = ''; |
|
| 97 | - |
|
| 98 | - if ( ! empty( $items ) ) { |
|
| 99 | - foreach ( $items as $args ) { |
|
| 100 | - $render = isset( $args['render'] ) ? $args['render'] : ''; |
|
| 101 | - if ( $render && method_exists( __CLASS__, $render ) ) { |
|
| 102 | - $output .= $this->$render( $args ); |
|
| 103 | - } |
|
| 104 | - } |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - if ( $echo ) { |
|
| 108 | - echo $output; |
|
| 109 | - }else{ |
|
| 110 | - return $output; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - /** |
|
| 116 | - * Render and return a bootstrap alert component. |
|
| 117 | - * |
|
| 118 | - * @since 1.0.0 |
|
| 119 | - * |
|
| 120 | - * @param array $args The function arguments. |
|
| 121 | - * @param bool $echo If we should return or echo. |
|
| 122 | - * |
|
| 123 | - * @return string The rendered component. |
|
| 124 | - */ |
|
| 125 | - public function alert( $args = array(), $echo = false ) { |
|
| 126 | - $output = AUI_Component_Alert::get( $args ); |
|
| 127 | - |
|
| 128 | - if ( $echo ) { |
|
| 129 | - echo $output; |
|
| 130 | - }else{ |
|
| 131 | - return $output; |
|
| 132 | - } |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - /** |
|
| 136 | - * Render and return a bootstrap input component. |
|
| 137 | - * |
|
| 138 | - * @since 1.0.0 |
|
| 139 | - * |
|
| 140 | - * @param array $args The function arguments. |
|
| 141 | - * @param bool $echo If we should return or echo. |
|
| 142 | - * |
|
| 143 | - * @return string The rendered component. |
|
| 144 | - */ |
|
| 145 | - public function input( $args = array(), $echo = false ) { |
|
| 146 | - $output = AUI_Component_Input::input( $args ); |
|
| 147 | - |
|
| 148 | - if ( $echo ) { |
|
| 149 | - echo $output; |
|
| 150 | - }else{ |
|
| 151 | - return $output; |
|
| 152 | - } |
|
| 153 | - } |
|
| 154 | - |
|
| 155 | - /** |
|
| 156 | - * Render and return a bootstrap textarea component. |
|
| 157 | - * |
|
| 158 | - * @since 1.0.0 |
|
| 159 | - * |
|
| 160 | - * @param array $args The function arguments. |
|
| 161 | - * @param bool $echo If we should return or echo. |
|
| 162 | - * |
|
| 163 | - * @return string The rendered component. |
|
| 164 | - */ |
|
| 165 | - public function textarea( $args = array(), $echo = false ) { |
|
| 166 | - $output = AUI_Component_Input::textarea( $args ); |
|
| 167 | - |
|
| 168 | - if ( $echo ) { |
|
| 169 | - echo $output; |
|
| 170 | - }else{ |
|
| 171 | - return $output; |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - /** |
|
| 176 | - * Render and return a bootstrap button component. |
|
| 177 | - * |
|
| 178 | - * @since 1.0.0 |
|
| 179 | - * |
|
| 180 | - * @param array $args The function arguments. |
|
| 181 | - * @param bool $echo If we should return or echo. |
|
| 182 | - * |
|
| 183 | - * @return string The rendered component. |
|
| 184 | - */ |
|
| 185 | - public function button( $args = array(), $echo = false ) { |
|
| 186 | - $output = AUI_Component_Button::get( $args ); |
|
| 187 | - |
|
| 188 | - if ( $echo ) { |
|
| 189 | - echo $output; |
|
| 190 | - }else{ |
|
| 191 | - return $output; |
|
| 192 | - } |
|
| 193 | - } |
|
| 194 | - |
|
| 195 | - /** |
|
| 196 | - * Render and return a bootstrap button component. |
|
| 197 | - * |
|
| 198 | - * @since 1.0.0 |
|
| 199 | - * |
|
| 200 | - * @param array $args The function arguments. |
|
| 201 | - * @param bool $echo If we should return or echo. |
|
| 202 | - * |
|
| 203 | - * @return string The rendered component. |
|
| 204 | - */ |
|
| 205 | - public function badge( $args = array(), $echo = false ) { |
|
| 206 | - $defaults = array( |
|
| 207 | - 'class' => 'badge badge-primary align-middle', |
|
| 208 | - ); |
|
| 209 | - |
|
| 210 | - // maybe set type. |
|
| 211 | - if ( empty( $args['href'] ) ) { |
|
| 212 | - $defaults['type'] = 'badge'; |
|
| 213 | - } |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * Parse incoming $args into an array and merge it with $defaults |
|
| 217 | - */ |
|
| 218 | - $args = wp_parse_args( $args, $defaults ); |
|
| 219 | - |
|
| 220 | - $output = AUI_Component_Button::get( $args ); |
|
| 221 | - |
|
| 222 | - if ( $echo ) { |
|
| 223 | - echo $output; |
|
| 224 | - }else{ |
|
| 225 | - return $output; |
|
| 226 | - } |
|
| 227 | - } |
|
| 228 | - |
|
| 229 | - /** |
|
| 230 | - * Render and return a bootstrap dropdown component. |
|
| 231 | - * |
|
| 232 | - * @since 1.0.0 |
|
| 233 | - * |
|
| 234 | - * @param array $args The function arguments. |
|
| 235 | - * @param bool $echo If we should return or echo. |
|
| 236 | - * |
|
| 237 | - * @return string The rendered component. |
|
| 238 | - */ |
|
| 239 | - public function dropdown( $args = array(), $echo = false ) { |
|
| 240 | - $output = AUI_Component_Dropdown::get( $args ); |
|
| 241 | - |
|
| 242 | - if ( $echo ) { |
|
| 243 | - echo $output; |
|
| 244 | - }else{ |
|
| 245 | - return $output; |
|
| 246 | - } |
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - /** |
|
| 250 | - * Render and return a bootstrap select component. |
|
| 251 | - * |
|
| 252 | - * @since 1.0.0 |
|
| 253 | - * |
|
| 254 | - * @param array $args The function arguments. |
|
| 255 | - * @param bool $echo If we should return or echo. |
|
| 256 | - * |
|
| 257 | - * @return string The rendered component. |
|
| 258 | - */ |
|
| 259 | - public function select( $args = array(), $echo = false ) { |
|
| 260 | - $output = AUI_Component_Input::select( $args ); |
|
| 261 | - |
|
| 262 | - if ( $echo ) { |
|
| 263 | - echo $output; |
|
| 264 | - }else{ |
|
| 265 | - return $output; |
|
| 266 | - } |
|
| 267 | - } |
|
| 268 | - |
|
| 269 | - /** |
|
| 270 | - * Render and return a bootstrap radio component. |
|
| 271 | - * |
|
| 272 | - * @since 1.0.0 |
|
| 273 | - * |
|
| 274 | - * @param array $args The function arguments. |
|
| 275 | - * @param bool $echo If we should return or echo. |
|
| 276 | - * |
|
| 277 | - * @return string The rendered component. |
|
| 278 | - */ |
|
| 279 | - public function radio( $args = array(), $echo = false ) { |
|
| 280 | - $output = AUI_Component_Input::radio( $args ); |
|
| 281 | - |
|
| 282 | - if ( $echo ) { |
|
| 283 | - echo $output; |
|
| 284 | - }else{ |
|
| 285 | - return $output; |
|
| 286 | - } |
|
| 287 | - } |
|
| 288 | - |
|
| 289 | - /** |
|
| 290 | - * Render and return a bootstrap pagination component. |
|
| 291 | - * |
|
| 292 | - * @since 1.0.0 |
|
| 293 | - * |
|
| 294 | - * @param array $args The function arguments. |
|
| 295 | - * @param bool $echo If we should return or echo. |
|
| 296 | - * |
|
| 297 | - * @return string The rendered component. |
|
| 298 | - */ |
|
| 299 | - public function pagination( $args = array(), $echo = false ) { |
|
| 300 | - $output = AUI_Component_Pagination::get( $args ); |
|
| 301 | - |
|
| 302 | - if ( $echo ) { |
|
| 303 | - echo $output; |
|
| 304 | - }else{ |
|
| 305 | - return $output; |
|
| 306 | - } |
|
| 307 | - } |
|
| 14 | + /** |
|
| 15 | + * Holds the class instance. |
|
| 16 | + * |
|
| 17 | + * @since 1.0.0 |
|
| 18 | + * @var null |
|
| 19 | + */ |
|
| 20 | + private static $instance = null; |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * Holds the current AUI version number. |
|
| 24 | + * |
|
| 25 | + * @var string $ver The current version number. |
|
| 26 | + */ |
|
| 27 | + public static $ver = '0.1.72'; |
|
| 28 | + |
|
| 29 | + public static $options = null; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * There can be only one. |
|
| 33 | + * |
|
| 34 | + * @since 1.0.0 |
|
| 35 | + * @return AUI|null |
|
| 36 | + */ |
|
| 37 | + public static function instance() { |
|
| 38 | + if ( self::$instance == null ) { |
|
| 39 | + self::$instance = new AUI(); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + return self::$instance; |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * AUI constructor. |
|
| 47 | + * |
|
| 48 | + * @since 1.0.0 |
|
| 49 | + */ |
|
| 50 | + private function __construct() { |
|
| 51 | + if ( function_exists( "__autoload" ) ) { |
|
| 52 | + spl_autoload_register( "__autoload" ); |
|
| 53 | + } |
|
| 54 | + spl_autoload_register( array( $this, 'autoload' ) ); |
|
| 55 | + |
|
| 56 | + // load options |
|
| 57 | + self::$options = get_option('aui_options'); |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Autoload any components on the fly. |
|
| 62 | + * |
|
| 63 | + * @since 1.0.0 |
|
| 64 | + * |
|
| 65 | + * @param $classname |
|
| 66 | + */ |
|
| 67 | + private function autoload( $classname ) { |
|
| 68 | + $class = str_replace( '_', '-', strtolower( $classname ) ); |
|
| 69 | + $file_path = trailingslashit( dirname( __FILE__ ) ) . "components/class-" . $class . '.php'; |
|
| 70 | + if ( $file_path && is_readable( $file_path ) ) { |
|
| 71 | + include_once( $file_path ); |
|
| 72 | + } |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * Get the AUI options. |
|
| 77 | + * |
|
| 78 | + * @param $option |
|
| 79 | + * |
|
| 80 | + * @return string|void |
|
| 81 | + */ |
|
| 82 | + public function get_option( $option ){ |
|
| 83 | + $result = isset(self::$options[$option]) ? esc_attr(self::$options[$option]) : ''; |
|
| 84 | + |
|
| 85 | + if ( ! $result && $option) { |
|
| 86 | + if( $option == 'color_primary' ){ |
|
| 87 | + $result = AUI_PRIMARY_COLOR; |
|
| 88 | + }elseif( $option == 'color_secondary' ){ |
|
| 89 | + $result = AUI_SECONDARY_COLOR; |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + return $result; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + public function render( $items = array(), $echo = false ) { |
|
| 96 | + $output = ''; |
|
| 97 | + |
|
| 98 | + if ( ! empty( $items ) ) { |
|
| 99 | + foreach ( $items as $args ) { |
|
| 100 | + $render = isset( $args['render'] ) ? $args['render'] : ''; |
|
| 101 | + if ( $render && method_exists( __CLASS__, $render ) ) { |
|
| 102 | + $output .= $this->$render( $args ); |
|
| 103 | + } |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + if ( $echo ) { |
|
| 108 | + echo $output; |
|
| 109 | + }else{ |
|
| 110 | + return $output; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + /** |
|
| 116 | + * Render and return a bootstrap alert component. |
|
| 117 | + * |
|
| 118 | + * @since 1.0.0 |
|
| 119 | + * |
|
| 120 | + * @param array $args The function arguments. |
|
| 121 | + * @param bool $echo If we should return or echo. |
|
| 122 | + * |
|
| 123 | + * @return string The rendered component. |
|
| 124 | + */ |
|
| 125 | + public function alert( $args = array(), $echo = false ) { |
|
| 126 | + $output = AUI_Component_Alert::get( $args ); |
|
| 127 | + |
|
| 128 | + if ( $echo ) { |
|
| 129 | + echo $output; |
|
| 130 | + }else{ |
|
| 131 | + return $output; |
|
| 132 | + } |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * Render and return a bootstrap input component. |
|
| 137 | + * |
|
| 138 | + * @since 1.0.0 |
|
| 139 | + * |
|
| 140 | + * @param array $args The function arguments. |
|
| 141 | + * @param bool $echo If we should return or echo. |
|
| 142 | + * |
|
| 143 | + * @return string The rendered component. |
|
| 144 | + */ |
|
| 145 | + public function input( $args = array(), $echo = false ) { |
|
| 146 | + $output = AUI_Component_Input::input( $args ); |
|
| 147 | + |
|
| 148 | + if ( $echo ) { |
|
| 149 | + echo $output; |
|
| 150 | + }else{ |
|
| 151 | + return $output; |
|
| 152 | + } |
|
| 153 | + } |
|
| 154 | + |
|
| 155 | + /** |
|
| 156 | + * Render and return a bootstrap textarea component. |
|
| 157 | + * |
|
| 158 | + * @since 1.0.0 |
|
| 159 | + * |
|
| 160 | + * @param array $args The function arguments. |
|
| 161 | + * @param bool $echo If we should return or echo. |
|
| 162 | + * |
|
| 163 | + * @return string The rendered component. |
|
| 164 | + */ |
|
| 165 | + public function textarea( $args = array(), $echo = false ) { |
|
| 166 | + $output = AUI_Component_Input::textarea( $args ); |
|
| 167 | + |
|
| 168 | + if ( $echo ) { |
|
| 169 | + echo $output; |
|
| 170 | + }else{ |
|
| 171 | + return $output; |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + /** |
|
| 176 | + * Render and return a bootstrap button component. |
|
| 177 | + * |
|
| 178 | + * @since 1.0.0 |
|
| 179 | + * |
|
| 180 | + * @param array $args The function arguments. |
|
| 181 | + * @param bool $echo If we should return or echo. |
|
| 182 | + * |
|
| 183 | + * @return string The rendered component. |
|
| 184 | + */ |
|
| 185 | + public function button( $args = array(), $echo = false ) { |
|
| 186 | + $output = AUI_Component_Button::get( $args ); |
|
| 187 | + |
|
| 188 | + if ( $echo ) { |
|
| 189 | + echo $output; |
|
| 190 | + }else{ |
|
| 191 | + return $output; |
|
| 192 | + } |
|
| 193 | + } |
|
| 194 | + |
|
| 195 | + /** |
|
| 196 | + * Render and return a bootstrap button component. |
|
| 197 | + * |
|
| 198 | + * @since 1.0.0 |
|
| 199 | + * |
|
| 200 | + * @param array $args The function arguments. |
|
| 201 | + * @param bool $echo If we should return or echo. |
|
| 202 | + * |
|
| 203 | + * @return string The rendered component. |
|
| 204 | + */ |
|
| 205 | + public function badge( $args = array(), $echo = false ) { |
|
| 206 | + $defaults = array( |
|
| 207 | + 'class' => 'badge badge-primary align-middle', |
|
| 208 | + ); |
|
| 209 | + |
|
| 210 | + // maybe set type. |
|
| 211 | + if ( empty( $args['href'] ) ) { |
|
| 212 | + $defaults['type'] = 'badge'; |
|
| 213 | + } |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * Parse incoming $args into an array and merge it with $defaults |
|
| 217 | + */ |
|
| 218 | + $args = wp_parse_args( $args, $defaults ); |
|
| 219 | + |
|
| 220 | + $output = AUI_Component_Button::get( $args ); |
|
| 221 | + |
|
| 222 | + if ( $echo ) { |
|
| 223 | + echo $output; |
|
| 224 | + }else{ |
|
| 225 | + return $output; |
|
| 226 | + } |
|
| 227 | + } |
|
| 228 | + |
|
| 229 | + /** |
|
| 230 | + * Render and return a bootstrap dropdown component. |
|
| 231 | + * |
|
| 232 | + * @since 1.0.0 |
|
| 233 | + * |
|
| 234 | + * @param array $args The function arguments. |
|
| 235 | + * @param bool $echo If we should return or echo. |
|
| 236 | + * |
|
| 237 | + * @return string The rendered component. |
|
| 238 | + */ |
|
| 239 | + public function dropdown( $args = array(), $echo = false ) { |
|
| 240 | + $output = AUI_Component_Dropdown::get( $args ); |
|
| 241 | + |
|
| 242 | + if ( $echo ) { |
|
| 243 | + echo $output; |
|
| 244 | + }else{ |
|
| 245 | + return $output; |
|
| 246 | + } |
|
| 247 | + } |
|
| 248 | + |
|
| 249 | + /** |
|
| 250 | + * Render and return a bootstrap select component. |
|
| 251 | + * |
|
| 252 | + * @since 1.0.0 |
|
| 253 | + * |
|
| 254 | + * @param array $args The function arguments. |
|
| 255 | + * @param bool $echo If we should return or echo. |
|
| 256 | + * |
|
| 257 | + * @return string The rendered component. |
|
| 258 | + */ |
|
| 259 | + public function select( $args = array(), $echo = false ) { |
|
| 260 | + $output = AUI_Component_Input::select( $args ); |
|
| 261 | + |
|
| 262 | + if ( $echo ) { |
|
| 263 | + echo $output; |
|
| 264 | + }else{ |
|
| 265 | + return $output; |
|
| 266 | + } |
|
| 267 | + } |
|
| 268 | + |
|
| 269 | + /** |
|
| 270 | + * Render and return a bootstrap radio component. |
|
| 271 | + * |
|
| 272 | + * @since 1.0.0 |
|
| 273 | + * |
|
| 274 | + * @param array $args The function arguments. |
|
| 275 | + * @param bool $echo If we should return or echo. |
|
| 276 | + * |
|
| 277 | + * @return string The rendered component. |
|
| 278 | + */ |
|
| 279 | + public function radio( $args = array(), $echo = false ) { |
|
| 280 | + $output = AUI_Component_Input::radio( $args ); |
|
| 281 | + |
|
| 282 | + if ( $echo ) { |
|
| 283 | + echo $output; |
|
| 284 | + }else{ |
|
| 285 | + return $output; |
|
| 286 | + } |
|
| 287 | + } |
|
| 288 | + |
|
| 289 | + /** |
|
| 290 | + * Render and return a bootstrap pagination component. |
|
| 291 | + * |
|
| 292 | + * @since 1.0.0 |
|
| 293 | + * |
|
| 294 | + * @param array $args The function arguments. |
|
| 295 | + * @param bool $echo If we should return or echo. |
|
| 296 | + * |
|
| 297 | + * @return string The rendered component. |
|
| 298 | + */ |
|
| 299 | + public function pagination( $args = array(), $echo = false ) { |
|
| 300 | + $output = AUI_Component_Pagination::get( $args ); |
|
| 301 | + |
|
| 302 | + if ( $echo ) { |
|
| 303 | + echo $output; |
|
| 304 | + }else{ |
|
| 305 | + return $output; |
|
| 306 | + } |
|
| 307 | + } |
|
| 308 | 308 | |
| 309 | 309 | } |
| 310 | 310 | \ No newline at end of file |
@@ -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 | aui()->alert( |
| 13 | 13 | array( |
| 14 | - 'content' => esc_html__( 'The gateway select box will appear here', 'invoicing' ), |
|
| 14 | + 'content' => esc_html__('The gateway select box will appear here', 'invoicing'), |
|
| 15 | 15 | 'type' => 'info', |
| 16 | 16 | ), |
| 17 | 17 | true |
@@ -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 | aui()->alert( |
| 13 | 13 | array( |
| 14 | - 'content' => esc_html__( 'The total payable amount will appear here', 'invoicing' ), |
|
| 14 | + 'content' => esc_html__('The total payable amount will appear here', 'invoicing'), |
|
| 15 | 15 | 'type' => 'info', |
| 16 | 16 | ), |
| 17 | 17 | true |