Prep Plugin for release on WordPress.org (#23)
* Update translation text domain * Escape everything that should be escaped. * Add nonce checks where needed. * Sanitize all inputs. * Apply Code style changes across the codebase. * Correct many deprecation notices. * Optimize load order of many filters. * Add Proper Build script * Use emojii flags * Fix i18n deprecation notice for translating too early * Put all scripts in footer and load async
This commit is contained in:
@ -171,7 +171,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
if ('grid' === $this->current_mode) {
|
||||
printf(
|
||||
'<button id="cb-select-all-grid" v-on:click.prevent="select_all" class="button">%s</button>',
|
||||
__('Select All', 'wp-ultimo')
|
||||
esc_html__('Select All', 'wp-multisite-waas')
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -192,13 +192,8 @@ class Base_List_Table extends \WP_List_Table {
|
||||
|
||||
$list_table_name = $this->id;
|
||||
|
||||
if ( ! empty($_REQUEST['mode'])) {
|
||||
if ( ! empty($_REQUEST['mode']) && in_array($_REQUEST['mode'], array_keys($this->modes), true)) {
|
||||
$mode = $_REQUEST['mode'];
|
||||
|
||||
if (in_array($mode, array_keys($this->modes), true)) {
|
||||
$mode = $_REQUEST['mode'];
|
||||
}
|
||||
|
||||
set_user_setting("{$list_table_name}_list_mode", $mode);
|
||||
} else {
|
||||
$mode = get_user_setting("{$list_table_name}_list_mode", current(array_keys($this->modes)));
|
||||
@ -405,7 +400,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
'base_url' => wu_get_form_url('bulk_actions'),
|
||||
'model' => strstr($this->get_table_id(), '_', true),
|
||||
'i18n' => [
|
||||
'confirm' => __('Confirm Action', 'wp-ultimo'),
|
||||
'confirm' => __('Confirm Action', 'wp-multisite-waas'),
|
||||
],
|
||||
]
|
||||
);
|
||||
@ -502,12 +497,12 @@ class Base_List_Table extends \WP_List_Table {
|
||||
* Any items at all?
|
||||
*/
|
||||
if ( ! $this->has_items() && 'page' === $this->context) {
|
||||
echo wu_render_empty_state(
|
||||
echo wu_render_empty_state( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'message' => sprintf(__("You don't have any %s yet.", 'wp-ultimo'), $this->labels['plural']),
|
||||
'sub_message' => $this->_args['add_new'] ? __('How about we create a new one?', 'wp-ultimo') : __('...but you will see them here once they get created.', 'wp-ultimo'),
|
||||
'message' => sprintf(__("You don't have any %s yet.", 'wp-multisite-waas'), $this->labels['plural']),
|
||||
'sub_message' => $this->_args['add_new'] ? __('How about we create a new one?', 'wp-multisite-waas') : __('...but you will see them here once they get created.', 'wp-multisite-waas'),
|
||||
// translators: %s is the singular value of the model, such as Product, or Payment.
|
||||
'link_label' => sprintf(__('Create a new %s', 'wp-ultimo'), $this->labels['singular']),
|
||||
'link_label' => sprintf(__('Create a new %s', 'wp-multisite-waas'), $this->labels['singular']),
|
||||
'link_url' => wu_get_isset($this->_args['add_new'], 'url', ''),
|
||||
'link_classes' => wu_get_isset($this->_args['add_new'], 'classes', ''),
|
||||
'link_icon' => 'dashicons-wu-circle-with-plus',
|
||||
@ -531,21 +526,19 @@ class Base_List_Table extends \WP_List_Table {
|
||||
|
||||
$views = apply_filters("wu_{$this->id}_get_views", $this->get_views());
|
||||
|
||||
if (true) {
|
||||
$args = array_merge(
|
||||
$filters,
|
||||
[
|
||||
'filters_el_id' => sprintf('%s-filters', $this->id),
|
||||
'has_search' => $this->has_search(),
|
||||
'search_label' => $this->get_search_input_label(),
|
||||
'views' => $views,
|
||||
'has_view_switch' => ! empty($this->modes),
|
||||
'table' => $this,
|
||||
]
|
||||
);
|
||||
$args = array_merge(
|
||||
$filters,
|
||||
[
|
||||
'filters_el_id' => sprintf('%s-filters', $this->id),
|
||||
'has_search' => $this->has_search(),
|
||||
'search_label' => $this->get_search_input_label(),
|
||||
'views' => $views,
|
||||
'has_view_switch' => ! empty($this->modes),
|
||||
'table' => $this,
|
||||
]
|
||||
);
|
||||
|
||||
wu_get_template('base/filter', $args);
|
||||
}
|
||||
wu_get_template('base/filter', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -596,7 +589,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
'<div class="wu-py-6 wu-text-gray-600 wu-text-sm wu-text-center">
|
||||
<span class="">%s</span>
|
||||
</div>',
|
||||
__('No items found', 'wp-ultimo')
|
||||
esc_html__('No items found', 'wp-multisite-waas')
|
||||
);
|
||||
}
|
||||
|
||||
@ -608,7 +601,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
public function get_bulk_actions() {
|
||||
|
||||
$default_bulk_actions = [
|
||||
'delete' => __('Delete', 'wp-ultimo'),
|
||||
'delete' => __('Delete', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
$has_active = $this->get_schema_columns(
|
||||
@ -618,8 +611,8 @@ class Base_List_Table extends \WP_List_Table {
|
||||
);
|
||||
|
||||
if ($has_active) {
|
||||
$default_bulk_actions['activate'] = __('Activate', 'wp-ultimo');
|
||||
$default_bulk_actions['deactivate'] = __('Deactivate', 'wp-ultimo');
|
||||
$default_bulk_actions['activate'] = __('Activate', 'wp-multisite-waas');
|
||||
$default_bulk_actions['deactivate'] = __('Deactivate', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return apply_filters('wu_bulk_actions', $default_bulk_actions, $this->id);
|
||||
@ -660,7 +653,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
$func_name = $prefix . $model;
|
||||
|
||||
if ( ! function_exists($func_name)) {
|
||||
return new \WP_Error('func-not-exists', __('Something went wrong.', 'wp-ultimo'));
|
||||
return new \WP_Error('func-not-exists', __('Something went wrong.', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
switch ($bulk_action) {
|
||||
@ -827,14 +820,14 @@ class Base_List_Table extends \WP_List_Table {
|
||||
public function _column_datetime($date) {
|
||||
|
||||
if ( ! wu_validate_date($date)) {
|
||||
return __('--', 'wp-ultimo');
|
||||
return __('--', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$time = strtotime(get_date_from_gmt((string) $date));
|
||||
|
||||
$formatted_value = date_i18n(get_option('date_format'), $time);
|
||||
|
||||
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
|
||||
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-multisite-waas') : __('In %s', 'wp-multisite-waas'); // phpcs:ignore
|
||||
|
||||
$text = $formatted_value . sprintf('<br><small>%s</small>', sprintf($placeholder, human_time_diff($time)));
|
||||
|
||||
@ -854,7 +847,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
$membership = $item->get_membership();
|
||||
|
||||
if ( ! $membership) {
|
||||
$not_found = __('No membership found', 'wp-ultimo');
|
||||
$not_found = __('No membership found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-table-card wu-text-gray-700 wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-block wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -902,7 +895,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
$payment = $item->get_payment();
|
||||
|
||||
if ( ! $payment) {
|
||||
$not_found = __('No payment found', 'wp-ultimo');
|
||||
$not_found = __('No payment found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-table-card wu-text-gray-700 wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-block wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -922,7 +915,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
|
||||
$reference = $payment->get_hash();
|
||||
|
||||
$description = sprintf(__('Total %s', 'wp-ultimo'), wu_format_currency($payment->get_total(), $payment->get_currency()));
|
||||
$description = sprintf(__('Total %s', 'wp-multisite-waas'), wu_format_currency($payment->get_total(), $payment->get_currency()));
|
||||
|
||||
$payment_link = wu_network_admin_url('wp-ultimo-edit-payment', $url_atts);
|
||||
|
||||
@ -950,7 +943,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
$customer = $item->get_customer();
|
||||
|
||||
if ( ! $customer) {
|
||||
$not_found = __('No customer found', 'wp-ultimo');
|
||||
$not_found = __('No customer found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-table-card wu-text-gray-700 wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -1007,7 +1000,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
$product = $item->get_plan();
|
||||
|
||||
if ( ! $product) {
|
||||
$not_found = __('No product found', 'wp-ultimo');
|
||||
$not_found = __('No product found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-table-card wu-text-gray-700 wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -1060,7 +1053,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
$site = $item->get_site();
|
||||
|
||||
if ( ! $site) {
|
||||
$not_found = __('No site found', 'wp-ultimo');
|
||||
$not_found = __('No site found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-table-card wu-text-gray-700 wu-py-0 wu-px-2 wu-flex wu-flex-grow wu-block wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -1095,7 +1088,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Product $item Product object.
|
||||
* @param \WP_Ultimo\Models\Product $item Product object.
|
||||
*/
|
||||
public function column_featured_image_id($item): string {
|
||||
|
||||
@ -1122,7 +1115,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
/**
|
||||
* Render the bulk edit checkbox.
|
||||
*
|
||||
* @param WP_Ultimo\Models\Product $item Product object.
|
||||
* @param \WP_Ultimo\Models\Product $item Product object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@ -1158,7 +1151,7 @@ class Base_List_Table extends \WP_List_Table {
|
||||
<script type='text/javascript'>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
let table_id = '<?php echo $this->_get_js_var_name(); ?>';
|
||||
let table_id = '<?php echo esc_js($this->_get_js_var_name()); ?>';
|
||||
|
||||
/**
|
||||
* Create the ajax List Table
|
||||
@ -1166,8 +1159,8 @@ class Base_List_Table extends \WP_List_Table {
|
||||
if (typeof window[table_id] === 'undefined') {
|
||||
|
||||
window[table_id + '_config'] = {
|
||||
filters: <?php echo json_encode($this->get_filters()); ?>,
|
||||
context: <?php echo json_encode($this->context); ?>,
|
||||
filters: <?php echo wp_json_encode($this->get_filters()); ?>,
|
||||
context: <?php echo wp_json_encode($this->context); ?>,
|
||||
}
|
||||
|
||||
window[table_id] = wu_create_list(table_id).init();
|
||||
@ -1220,47 +1213,47 @@ class Base_List_Table extends \WP_List_Table {
|
||||
|
||||
return [
|
||||
'all' => [
|
||||
'label' => __('All', 'wp-ultimo'),
|
||||
'label' => __('All', 'wp-multisite-waas'),
|
||||
'after' => null,
|
||||
'before' => null,
|
||||
],
|
||||
'today' => [
|
||||
'label' => __('Today', 'wp-ultimo'),
|
||||
'label' => __('Today', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('today')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('today')),
|
||||
],
|
||||
'yesterday' => [
|
||||
'label' => __('Yesterday', 'wp-ultimo'),
|
||||
'label' => __('Yesterday', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('yesterday')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('yesterday')),
|
||||
],
|
||||
'last_week' => [
|
||||
'label' => __('Last 7 Days', 'wp-ultimo'),
|
||||
'label' => __('Last 7 Days', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('last week')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('today')),
|
||||
],
|
||||
'last_month' => [
|
||||
'label' => __('Last 30 Days', 'wp-ultimo'),
|
||||
'label' => __('Last 30 Days', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('last month')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('today')),
|
||||
],
|
||||
'current_month' => [
|
||||
'label' => __('Current Month', 'wp-ultimo'),
|
||||
'label' => __('Current Month', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('first day of this month')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('today')),
|
||||
],
|
||||
'last_year' => [
|
||||
'label' => __('Last 12 Months', 'wp-ultimo'),
|
||||
'label' => __('Last 12 Months', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('last year')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('today')),
|
||||
],
|
||||
'year_to_date' => [
|
||||
'label' => __('Year to Date', 'wp-ultimo'),
|
||||
'label' => __('Year to Date', 'wp-multisite-waas'),
|
||||
'after' => date_i18n('Y-m-d 00:00:00', strtotime('first day of january this year')),
|
||||
'before' => date_i18n('Y-m-d 23:59:59', strtotime('today')),
|
||||
],
|
||||
'custom' => [
|
||||
'label' => __('Custom', 'wp-ultimo'),
|
||||
'label' => __('Custom', 'wp-multisite-waas'),
|
||||
'after' => null,
|
||||
'before' => null,
|
||||
],
|
||||
@ -1409,7 +1402,8 @@ class Base_List_Table extends \WP_List_Table {
|
||||
'all' => [
|
||||
'field' => 'type',
|
||||
'url' => '#',
|
||||
'label' => sprintf(__('All %s', 'wp-ultimo'), $this->get_label('plural')),
|
||||
// translators: %s will be replaced with a plural label
|
||||
'label' => sprintf(__('All %s', 'wp-multisite-waas'), $this->get_label('plural')),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
@ -36,8 +36,8 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Broadcast', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Broadcasts', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Broadcast', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Broadcasts', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_broadcast_message'),
|
||||
@ -79,13 +79,13 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
$class = 'wu-bg-gray-200';
|
||||
|
||||
if ('broadcast_email' === $type) {
|
||||
$label = __('Email', 'wp-ultimo');
|
||||
$label = __('Email', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ('broadcast_notice' === $type) {
|
||||
$status = $item->get_notice_type();
|
||||
|
||||
$label = __('Notice', 'wp-ultimo');
|
||||
$label = __('Notice', 'wp-multisite-waas');
|
||||
|
||||
if ('info' === $status) {
|
||||
$class = 'wu-bg-blue-200';
|
||||
@ -121,8 +121,8 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
];
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-broadcast', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-broadcast', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-multisite-waas'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $title . $content . $this->row_actions($actions);
|
||||
@ -148,7 +148,7 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
|
||||
switch ($targets_count) {
|
||||
case 0:
|
||||
$not_found = __('No customer found', 'wp-ultimo');
|
||||
$not_found = __('No customer found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-p-2 wu-mr-1 wu-flex wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-bg-gray-100 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -235,9 +235,9 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
<a href="%s" title="%s" class="wubox"><span class="wu-ml-6 wu-uppercase wu-text-xs wu-font-bold"> %s %s</span></a>
|
||||
</div>',
|
||||
wu_get_form_url('view_broadcast_targets', $modal_atts),
|
||||
__('Targets', 'wp-ultimo'),
|
||||
__('Targets', 'wp-multisite-waas'),
|
||||
$targets_count,
|
||||
__('Targets', 'wp-ultimo')
|
||||
__('Targets', 'wp-multisite-waas')
|
||||
);
|
||||
|
||||
$html .= '</div>';
|
||||
@ -258,9 +258,9 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
<a href="%s" title="%s" class="wubox"><span class="wu-pl-2 wu-uppercase wu-text-xs wu-font-bold"> %s %s</span></a>
|
||||
</div>',
|
||||
wu_get_form_url('view_broadcast_targets', $modal_atts),
|
||||
__('Targets', 'wp-ultimo'),
|
||||
__('Targets', 'wp-multisite-waas'),
|
||||
$targets_count,
|
||||
__('Targets', 'wp-ultimo')
|
||||
__('Targets', 'wp-multisite-waas')
|
||||
);
|
||||
|
||||
$html .= '</div>';
|
||||
@ -291,7 +291,7 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
|
||||
switch ($product_count) {
|
||||
case 0:
|
||||
$not_found = __('No product found', 'wp-ultimo');
|
||||
$not_found = __('No product found', 'wp-multisite-waas');
|
||||
|
||||
$html = "<div class='wu-p-2 wu-mr-1 wu-flex wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-bg-gray-100 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -325,7 +325,7 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
$customer_count = count($plan_customers);
|
||||
}
|
||||
|
||||
$description = sprintf(__('%s customer(s) targeted.', 'wp-ultimo'), $customer_count);
|
||||
$description = sprintf(__('%s customer(s) targeted.', 'wp-multisite-waas'), $customer_count);
|
||||
|
||||
$url_atts = [
|
||||
'id' => $product->get_id(),
|
||||
@ -384,9 +384,9 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
'<div class="wu-inline-block wu-ml-4">
|
||||
<a href="%s" title="%s" class="wubox"><span class="wu-pl-2 wu-uppercase wu-text-xs wu-font-bold"> %s %s</span></a></div>',
|
||||
wu_get_form_url('view_broadcast_targets', $modal_atts),
|
||||
__('Targets', 'wp-ultimo'),
|
||||
__('Targets', 'wp-multisite-waas'),
|
||||
$product_count,
|
||||
__('Targets', 'wp-ultimo')
|
||||
__('Targets', 'wp-multisite-waas')
|
||||
);
|
||||
|
||||
$html .= '</div>';
|
||||
@ -402,7 +402,7 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
'target_type' => 'products',
|
||||
];
|
||||
|
||||
$html .= sprintf('<div class="wu-inline-block wu-ml-4"><a href="%s" title="%s" class="wubox"><span class="wu-pl-2 wu-uppercase wu-text-xs wu-font-bold"> %s %s</span></a></div>', wu_get_form_url('view_broadcast_targets', $modal_atts), __('Targets', 'wp-ultimo'), $product_count, __('Targets', 'wp-ultimo'));
|
||||
$html .= sprintf('<div class="wu-inline-block wu-ml-4"><a href="%s" title="%s" class="wubox"><span class="wu-pl-2 wu-uppercase wu-text-xs wu-font-bold"> %s %s</span></a></div>', wu_get_form_url('view_broadcast_targets', $modal_atts), __('Targets', 'wp-multisite-waas'), $product_count, __('Targets', 'wp-multisite-waas'));
|
||||
|
||||
$html .= '</div>';
|
||||
|
||||
@ -419,12 +419,12 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'type' => __('Type', 'wp-ultimo'),
|
||||
'the_content' => __('Content', 'wp-ultimo'),
|
||||
'target_customers' => __('Target Customers', 'wp-ultimo'),
|
||||
'target_products' => __('Target Products', 'wp-ultimo'),
|
||||
'date_created' => __('Date', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'type' => __('Type', 'wp-multisite-waas'),
|
||||
'the_content' => __('Content', 'wp-multisite-waas'),
|
||||
'target_customers' => __('Target Customers', 'wp-multisite-waas'),
|
||||
'target_products' => __('Target Products', 'wp-multisite-waas'),
|
||||
'date_created' => __('Date', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -440,25 +440,25 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
return [
|
||||
'filters' => [
|
||||
'type' => [
|
||||
'label' => __('Broadcast Type', 'wp-ultimo'),
|
||||
'label' => __('Broadcast Type', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'broadcast_notice' => __('Email', 'wp-ultimo'),
|
||||
'broadcast_email' => __('Notices', 'wp-ultimo'),
|
||||
'broadcast_notice' => __('Email', 'wp-multisite-waas'),
|
||||
'broadcast_email' => __('Notices', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
'status' => [
|
||||
'label' => __('Notice Type', 'wp-ultimo'),
|
||||
'label' => __('Notice Type', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'info' => __('Info - Blue', 'wp-ultimo'),
|
||||
'success' => __('Success - Green', 'wp-ultimo'),
|
||||
'warning' => __('Warning - Yellow', 'wp-ultimo'),
|
||||
'error' => __('Error - Red', 'wp-ultimo'),
|
||||
'info' => __('Info - Blue', 'wp-multisite-waas'),
|
||||
'success' => __('Success - Green', 'wp-multisite-waas'),
|
||||
'warning' => __('Warning - Yellow', 'wp-multisite-waas'),
|
||||
'error' => __('Error - Red', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
],
|
||||
'date_filters' => [
|
||||
'date_created' => [
|
||||
'label' => __('Date', 'wp-ultimo'),
|
||||
'label' => __('Date', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
],
|
||||
@ -488,19 +488,19 @@ class Broadcast_List_Table extends Base_List_Table {
|
||||
'all' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('type', 'all'),
|
||||
'label' => __('All Broadcasts', 'wp-ultimo'),
|
||||
'label' => __('All Broadcasts', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'broadcast_email' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'broadcast_email'),
|
||||
'label' => __('Emails', 'wp-ultimo'),
|
||||
'label' => __('Emails', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'broadcast_notice' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'broadcast_notice'),
|
||||
'label' => __('Notices', 'wp-ultimo'),
|
||||
'label' => __('Notices', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
@ -36,8 +36,8 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Checkout Form', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Checkout Forms', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Checkout Form', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Checkout Forms', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_checkout_form'),
|
||||
@ -65,7 +65,7 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
$title = sprintf('<strong><a href="%s">%s</a></strong>', wu_network_admin_url('wp-ultimo-edit-checkout-form', $url_atts), $item->get_name());
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-checkout-form', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-checkout-form', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'duplicate' => sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
wu_network_admin_url(
|
||||
@ -75,10 +75,10 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
'id' => $item->get_id(),
|
||||
]
|
||||
),
|
||||
__('Duplicate', 'wp-ultimo')
|
||||
__('Duplicate', 'wp-multisite-waas')
|
||||
),
|
||||
'get_shortcode' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Shortcode', 'wp-ultimo'), wu_get_form_url('shortcode_checkout', $url_atts), __('Shortcode', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
'get_shortcode' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Shortcode', 'wp-multisite-waas'), wu_get_form_url('shortcode_checkout', $url_atts), __('Shortcode', 'wp-multisite-waas')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-multisite-waas'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $title . $this->row_actions($actions);
|
||||
@ -108,7 +108,7 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function column_steps($item): string {
|
||||
|
||||
return sprintf(__('%1$d Step(s) and %2$d Field(s)', 'wp-ultimo'), $item->get_step_count(), $item->get_field_count());
|
||||
return sprintf(__('%1$d Step(s) and %2$d Field(s)', 'wp-multisite-waas'), $item->get_step_count(), $item->get_field_count());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -125,7 +125,7 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
<button type="button" data-clipboard-action="copy" data-clipboard-target="#hidden_textarea" class="btn-clipboard" title="%s">
|
||||
<span class="dashicons-wu-copy"></span>
|
||||
</button>',
|
||||
__('Copy to the Clipboard', 'wp-ultimo')
|
||||
__('Copy to the Clipboard', 'wp-multisite-waas')
|
||||
);
|
||||
|
||||
return sprintf('<input class="wu-bg-gray-200 wu-border-none wu-text-gray-700 wu-py-1 wu-px-2 wu-rounded-sm wu-text-xs wu-font-mono" value="%s">', esc_attr($item->get_shortcode()), '');
|
||||
@ -147,14 +147,15 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
$checkout_form = wu_get_checkout_form($checkout_form_id);
|
||||
|
||||
if ( ! $checkout_form) {
|
||||
WP_Ultimo()->notices->add(__('Checkout form not found.', 'wp-ultimo'), 'error', 'network-admin');
|
||||
WP_Ultimo()->notices->add(__('Checkout form not found.', 'wp-multisite-waas'), 'error', 'network-admin');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$new_checkout_form = $checkout_form->duplicate();
|
||||
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-ultimo'), $checkout_form->get_name());
|
||||
// translators: the %s is the thing copied.
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-multisite-waas'), $checkout_form->get_name());
|
||||
|
||||
$new_checkout_form->set_name($new_name);
|
||||
|
||||
@ -178,7 +179,7 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
]
|
||||
);
|
||||
|
||||
wp_redirect($redirect_url);
|
||||
wp_safe_redirect($redirect_url);
|
||||
|
||||
exit;
|
||||
}
|
||||
@ -194,10 +195,10 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'name' => __('Form Name', 'wp-ultimo'),
|
||||
'slug' => __('Form Slug', 'wp-ultimo'),
|
||||
'steps' => __('Steps', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'name' => __('Form Name', 'wp-multisite-waas'),
|
||||
'slug' => __('Form Slug', 'wp-multisite-waas'),
|
||||
'steps' => __('Steps', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -43,8 +43,8 @@ class Customer_List_Table extends Base_List_Table {
|
||||
$args = wp_parse_args(
|
||||
$args,
|
||||
[
|
||||
'singular' => __('Customer', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Customers', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Customer', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Customers', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_customer'),
|
||||
@ -66,7 +66,7 @@ class Customer_List_Table extends Base_List_Table {
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
|
||||
$search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : false;
|
||||
$search = isset($_GET['s']) ? sanitize_text_field(wp_unslash($_GET['s'])) : false;
|
||||
|
||||
if ( ! empty($search)) {
|
||||
|
||||
@ -122,10 +122,10 @@ class Customer_List_Table extends Base_List_Table {
|
||||
// Check if user exists
|
||||
if ( ! $user) {
|
||||
$actions = [
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-multisite-waas'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return sprintf('<strong>#%s</strong> - %s', $item->get_user_id(), __('User not found', 'wp-ultimo')) . $this->row_actions($actions);
|
||||
return sprintf('<strong>#%s</strong> - %s', $item->get_user_id(), __('User not found', 'wp-multisite-waas')) . $this->row_actions($actions);
|
||||
}
|
||||
|
||||
$customer_id = sprintf('<a href="?page=wp-ultimo-edit-customer&id=%s"><strong>#%s</strong></a>', $item->get_id(), $item->get_id());
|
||||
@ -144,19 +144,19 @@ class Customer_List_Table extends Base_List_Table {
|
||||
// Concatenate the two blocks
|
||||
$title = "<strong>$customer_user</strong>";
|
||||
|
||||
$desc = sprintf('<a %s href="mailto:%s" class="description wu-ml-1 wu-text-xs">(%s)</a>', wu_tooltip_text(__('Send an email to this customer', 'wp-ultimo')), $user->user_email, $user->user_email);
|
||||
$desc = sprintf('<a %s href="mailto:%s" class="description wu-ml-1 wu-text-xs">(%s)</a>', wu_tooltip_text(__('Send an email to this customer', 'wp-multisite-waas')), $user->user_email, $user->user_email);
|
||||
|
||||
// Concatenate switch to url
|
||||
$is_modal_switch_to = \WP_Ultimo\User_Switching::get_instance()->check_user_switching_is_activated() ? '' : 'wubox';
|
||||
|
||||
$url_switch_to = sprintf('<a title="%s" class="%s" href="%s">%s</a>', __('Switch To', 'wp-ultimo'), $is_modal_switch_to, \WP_Ultimo\User_Switching::get_instance()->render($item->get_user_id()), __('Switch To', 'wp-ultimo'));
|
||||
$url_switch_to = sprintf('<a title="%s" class="%s" href="%s">%s</a>', __('Switch To', 'wp-multisite-waas'), $is_modal_switch_to, \WP_Ultimo\User_Switching::get_instance()->render($item->get_user_id()), __('Switch To', 'wp-multisite-waas'));
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-customer', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-customer', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'switch-to' => $item->get_user_id() !== get_current_user_id() ? $url_switch_to : false,
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
[
|
||||
@ -164,7 +164,7 @@ class Customer_List_Table extends Base_List_Table {
|
||||
'id' => $item->get_id(),
|
||||
]
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -186,7 +186,7 @@ class Customer_List_Table extends Base_List_Table {
|
||||
$html = '<div class="wu-status-container">';
|
||||
|
||||
if ($item->is_vip()) {
|
||||
$html .= sprintf('<span class="wu-tag wu-customer-vip">%s</span>', __('VIP', 'wp-ultimo'));
|
||||
$html .= sprintf('<span class="wu-tag wu-customer-vip">%s</span>', __('VIP', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$html .= get_avatar(
|
||||
@ -221,7 +221,7 @@ class Customer_List_Table extends Base_List_Table {
|
||||
];
|
||||
|
||||
$actions = [
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-memberships', $url_atts), __('View', 'wp-ultimo')),
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-memberships', $url_atts), __('View', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $subscription_count . $this->row_actions($actions);
|
||||
@ -238,11 +238,11 @@ class Customer_List_Table extends Base_List_Table {
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'customer_status' => '',
|
||||
'name' => __('Name', 'wp-ultimo'),
|
||||
'last_login' => __('Last Login', 'wp-ultimo'),
|
||||
'date_registered' => __('Customer Since', 'wp-ultimo'),
|
||||
'memberships' => __('Memberships', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'name' => __('Name', 'wp-multisite-waas'),
|
||||
'last_login' => __('Last Login', 'wp-multisite-waas'),
|
||||
'date_registered' => __('Customer Since', 'wp-multisite-waas'),
|
||||
'memberships' => __('Memberships', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -331,19 +331,19 @@ class Customer_List_Table extends Base_List_Table {
|
||||
'filter' => 'all',
|
||||
]
|
||||
),
|
||||
'label' => __('All Customers', 'wp-ultimo'),
|
||||
'label' => __('All Customers', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'vip' => [
|
||||
'field' => 'filter',
|
||||
'url' => add_query_arg('filter', 'vip'),
|
||||
'label' => __('VIP Customers', 'wp-ultimo'),
|
||||
'label' => __('VIP Customers', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'online' => [
|
||||
'field' => 'filter',
|
||||
'url' => add_query_arg('filter', 'online'),
|
||||
'label' => __('Online Customers', 'wp-ultimo'),
|
||||
'label' => __('Online Customers', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
@ -360,7 +360,7 @@ class Customer_List_Table extends Base_List_Table {
|
||||
public function column_last_login($item) {
|
||||
|
||||
if ($item->is_online()) {
|
||||
return '<span class="wu-inline-block wu-mr-1 wu-rounded-full wu-h-2 wu-w-2 wu-bg-green-500"></span>' . __('Online', 'wp-ultimo');
|
||||
return '<span class="wu-inline-block wu-mr-1 wu-rounded-full wu-h-2 wu-w-2 wu-bg-green-500"></span>' . __('Online', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return $this->_column_datetime($item->get_last_login());
|
||||
|
@ -50,7 +50,7 @@ class Customers_Membership_List_Table extends Membership_List_Table {
|
||||
|
||||
$product_count = 1 + count($item->get_addon_ids());
|
||||
|
||||
$products_list = $p ? sprintf(_n('Contains %s', 'Contains %1$s and %2$s other product(s)', $product_count, 'wp-ultimo'), $p->get_name(), count($item->get_addon_ids())) : ''; // phpcs:ignore
|
||||
$products_list = $p ? sprintf(_n('Contains %s', 'Contains %1$s and %2$s other product(s)', $product_count, 'wp-multisite-waas'), $p->get_name(), count($item->get_addon_ids())) : ''; // phpcs:ignore
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
[
|
||||
@ -67,30 +67,30 @@ class Customers_Membership_List_Table extends Membership_List_Table {
|
||||
[
|
||||
'total' => [
|
||||
'icon' => 'dashicons-wu-shopping-bag1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Payment Total', 'wp-ultimo'),
|
||||
'label' => __('Payment Total', 'wp-multisite-waas'),
|
||||
'value' => $item->get_price_description(),
|
||||
],
|
||||
'products' => [
|
||||
'icon' => 'dashicons-wu-package wu-align-middle wu-mr-1',
|
||||
'label' => __('Products', 'wp-ultimo'),
|
||||
'label' => __('Products', 'wp-multisite-waas'),
|
||||
'value' => $products_list,
|
||||
],
|
||||
'gateway' => [
|
||||
'icon' => 'dashicons-wu-credit-card2 wu-align-middle wu-mr-1',
|
||||
'label' => __('Gateway', 'wp-ultimo'),
|
||||
'label' => __('Gateway', 'wp-multisite-waas'),
|
||||
'value' => wu_slug_to_name($item->get_gateway()),
|
||||
],
|
||||
],
|
||||
[
|
||||
'date_expiration' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Expires', 'wp-ultimo'),
|
||||
'value' => sprintf($expired ? __('Expired %s', 'wp-ultimo') : __('Expiring %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_expiration()))),
|
||||
'label' => __('Expires', 'wp-multisite-waas'),
|
||||
'value' => sprintf($expired ? __('Expired %s', 'wp-multisite-waas') : __('Expiring %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_expiration()))),
|
||||
],
|
||||
'date_created' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Created at', 'wp-ultimo'),
|
||||
'value' => sprintf(__('Created %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_created()))),
|
||||
'label' => __('Created at', 'wp-multisite-waas'),
|
||||
'value' => sprintf(__('Created %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_created()))),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -44,7 +44,7 @@ class Customers_Payment_List_Table extends Payment_List_Table {
|
||||
*/
|
||||
public function column_responsive($item): void {
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'id' => $item->get_id(),
|
||||
'title' => $item->get_hash(),
|
||||
@ -59,12 +59,12 @@ class Customers_Payment_List_Table extends Payment_List_Table {
|
||||
[
|
||||
'total' => [
|
||||
'icon' => 'dashicons-wu-shopping-bag1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Payment Total', 'wp-ultimo'),
|
||||
'label' => __('Payment Total', 'wp-multisite-waas'),
|
||||
'value' => wu_format_currency($item->get_total()),
|
||||
],
|
||||
'gateway' => [
|
||||
'icon' => 'dashicons-wu-credit-card2 wu-align-middle wu-mr-1',
|
||||
'label' => __('Gateway', 'wp-ultimo'),
|
||||
'label' => __('Gateway', 'wp-multisite-waas'),
|
||||
'value' => wu_slug_to_name($item->get_gateway()),
|
||||
],
|
||||
],
|
||||
@ -72,7 +72,7 @@ class Customers_Payment_List_Table extends Payment_List_Table {
|
||||
'date_created' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => sprintf(__('Created %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_created()))),
|
||||
'value' => sprintf(__('Created %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_created()))),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -76,19 +76,19 @@ class Customers_Site_List_Table extends Site_List_Table {
|
||||
[
|
||||
'link' => [
|
||||
'icon' => 'dashicons-wu-link1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Visit Site', 'wp-ultimo'),
|
||||
'label' => __('Visit Site', 'wp-multisite-waas'),
|
||||
'url' => $item->get_active_site_url(),
|
||||
'value' => $item->get_active_site_url(),
|
||||
],
|
||||
'dashboard' => [
|
||||
'icon' => 'dashicons-wu-browser wu-align-middle wu-mr-1',
|
||||
'label' => __('Go to the Dashboard', 'wp-ultimo'),
|
||||
'value' => __('Dashboard', 'wp-ultimo'),
|
||||
'label' => __('Go to the Dashboard', 'wp-multisite-waas'),
|
||||
'value' => __('Dashboard', 'wp-multisite-waas'),
|
||||
'url' => get_admin_url($item->get_id()),
|
||||
],
|
||||
'membership' => [
|
||||
'icon' => 'dashicons-wu-rotate-ccw wu-align-middle wu-mr-1',
|
||||
'label' => __('Go to the Membership', 'wp-ultimo'),
|
||||
'label' => __('Go to the Membership', 'wp-multisite-waas'),
|
||||
'value' => $m ? $m->get_hash() : '',
|
||||
'url' => $m ? wu_network_admin_url(
|
||||
'wp-ultimo-edit-membership',
|
||||
@ -103,7 +103,7 @@ class Customers_Site_List_Table extends Site_List_Table {
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
/* translators: the placeholder is a date */
|
||||
'value' => $item->get_type() === 'pending' ? __('Not Available', 'wp-ultimo') : sprintf(__('Created %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_registered()))),
|
||||
'value' => $item->get_type() === 'pending' ? __('Not Available', 'wp-multisite-waas') : sprintf(__('Created %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_registered()))),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -36,8 +36,8 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Discount Code', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Discount Codes', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Discount Code', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Discount Codes', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_network_admin_url('wp-ultimo-edit-discount-code'),
|
||||
@ -64,15 +64,15 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
$title = sprintf('<a href="%s"><strong>%s</strong></a>', wu_network_admin_url('wp-ultimo-edit-discount-code', $url_atts), $item->get_name());
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-discount-code', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-discount-code', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
$url_atts
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -91,7 +91,7 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
public function column_value($item) {
|
||||
|
||||
if ( ! $item->get_value()) {
|
||||
return __('No Discount', 'wp-ultimo');
|
||||
return __('No Discount', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$value = wu_format_currency($item->get_value());
|
||||
@ -101,7 +101,7 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
}
|
||||
|
||||
// translators: placeholder is the amount of discount. e.g. 10% or $5.
|
||||
return sprintf(__('%s OFF', 'wp-ultimo'), $value);
|
||||
return sprintf(__('%s OFF', 'wp-multisite-waas'), $value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,7 +116,7 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
public function column_setup_fee_value($item) {
|
||||
|
||||
if ( ! $item->get_setup_fee_value()) {
|
||||
return __('No Discount', 'wp-ultimo');
|
||||
return __('No Discount', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$value = wu_format_currency($item->get_setup_fee_value());
|
||||
@ -126,7 +126,7 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
}
|
||||
|
||||
// translators: placeholder is the amount of discount. e.g. 10% or $5.
|
||||
return sprintf(__('%s OFF', 'wp-ultimo'), $value);
|
||||
return sprintf(__('%s OFF', 'wp-multisite-waas'), $value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -140,14 +140,14 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
public function column_uses($item) {
|
||||
|
||||
// translators: the placeholder is the number of times this coupon was used.
|
||||
$html = sprintf(__('Used %d time(s)', 'wp-ultimo'), $item->get_uses());
|
||||
$html = sprintf(__('Used %d time(s)', 'wp-multisite-waas'), $item->get_uses());
|
||||
|
||||
if ($item->get_max_uses() > 0) {
|
||||
|
||||
// translators: the placeholder is the number of times this coupon can be used before becoming inactive.
|
||||
$html .= '<small class="wu-block">' . sprintf(__('Allowed uses: %d', 'wp-ultimo'), $item->get_max_uses()) . '</span>';
|
||||
$html .= '<small class="wu-block">' . sprintf(__('Allowed uses: %d', 'wp-multisite-waas'), $item->get_max_uses()) . '</span>';
|
||||
} else {
|
||||
$html .= '<small class="wu-block">' . __('No Limits', 'wp-ultimo') . '</span>';
|
||||
$html .= '<small class="wu-block">' . __('No Limits', 'wp-multisite-waas') . '</span>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
@ -170,7 +170,7 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
$valid = $item->is_valid();
|
||||
|
||||
if (is_wp_error($valid)) {
|
||||
$html .= sprintf('<small class="wu-block wu-sans" %s>%s</small>', wu_tooltip_text($valid->get_error_message()), __('Inactive', 'wp-ultimo'));
|
||||
$html .= sprintf('<small class="wu-block wu-sans" %s>%s</small>', wu_tooltip_text($valid->get_error_message()), __('Inactive', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
return $html;
|
||||
@ -186,12 +186,12 @@ class Discount_Code_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'name' => __('Name', 'wp-ultimo'),
|
||||
'coupon_code' => __('Code', 'wp-ultimo'),
|
||||
'uses' => __('Uses', 'wp-ultimo'),
|
||||
'value' => __('Value', 'wp-ultimo'),
|
||||
'setup_fee_value' => __('Setup Fee Value', 'wp-ultimo'),
|
||||
'date_expiration' => __('Dates', 'wp-ultimo'),
|
||||
'name' => __('Name', 'wp-multisite-waas'),
|
||||
'coupon_code' => __('Code', 'wp-multisite-waas'),
|
||||
'uses' => __('Uses', 'wp-multisite-waas'),
|
||||
'value' => __('Value', 'wp-multisite-waas'),
|
||||
'setup_fee_value' => __('Setup Fee Value', 'wp-multisite-waas'),
|
||||
'date_expiration' => __('Dates', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -39,8 +39,8 @@ class Domain_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Domain', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Domains', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Domain', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Domains', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_domain'),
|
||||
@ -86,8 +86,8 @@ class Domain_List_Table extends Base_List_Table {
|
||||
$html = "<span class='wu-font-mono'><strong>{$domain}</strong></span>";
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-domain', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-domain', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-multisite-waas'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $html . $this->row_actions($actions);
|
||||
@ -103,7 +103,7 @@ class Domain_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function column_active($item) {
|
||||
|
||||
return $item->is_active() ? __('Yes', 'wp-ultimo') : __('No', 'wp-ultimo');
|
||||
return $item->is_active() ? __('Yes', 'wp-multisite-waas') : __('No', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,7 +116,7 @@ class Domain_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function column_primary_domain($item) {
|
||||
|
||||
return $item->is_primary_domain() ? __('Yes', 'wp-ultimo') : __('No', 'wp-ultimo');
|
||||
return $item->is_primary_domain() ? __('Yes', 'wp-multisite-waas') : __('No', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,7 +129,7 @@ class Domain_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function column_secure($item) {
|
||||
|
||||
return $item->is_secure() ? __('Yes', 'wp-ultimo') : __('No', 'wp-ultimo');
|
||||
return $item->is_secure() ? __('Yes', 'wp-multisite-waas') : __('No', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -159,13 +159,13 @@ class Domain_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'domain' => __('Domain', 'wp-ultimo'),
|
||||
'stage' => __('Stage', 'wp-ultimo'),
|
||||
'blog_id' => __('Site', 'wp-ultimo'),
|
||||
'active' => __('Active', 'wp-ultimo'),
|
||||
'primary_domain' => __('Primary', 'wp-ultimo'),
|
||||
'secure' => __('HTTPS', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'domain' => __('Domain', 'wp-multisite-waas'),
|
||||
'stage' => __('Stage', 'wp-multisite-waas'),
|
||||
'blog_id' => __('Site', 'wp-multisite-waas'),
|
||||
'active' => __('Active', 'wp-multisite-waas'),
|
||||
'primary_domain' => __('Primary', 'wp-multisite-waas'),
|
||||
'secure' => __('HTTPS', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -185,10 +185,10 @@ class Domain_List_Table extends Base_List_Table {
|
||||
* Active
|
||||
*/
|
||||
'active' => [
|
||||
'label' => __('Active', 'wp-ultimo'),
|
||||
'label' => __('Active', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
0 => __('Inactive', 'wp-ultimo'),
|
||||
1 => __('Active', 'wp-ultimo'),
|
||||
0 => __('Inactive', 'wp-multisite-waas'),
|
||||
1 => __('Active', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
|
||||
@ -196,10 +196,10 @@ class Domain_List_Table extends Base_List_Table {
|
||||
* Primay
|
||||
*/
|
||||
'primary_domain' => [
|
||||
'label' => __('Is Primary', 'wp-ultimo'),
|
||||
'label' => __('Is Primary', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
0 => __('Not Primary Domain', 'wp-ultimo'),
|
||||
1 => __('Primary Domain', 'wp-ultimo'),
|
||||
0 => __('Not Primary Domain', 'wp-multisite-waas'),
|
||||
1 => __('Primary Domain', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
|
||||
@ -207,10 +207,10 @@ class Domain_List_Table extends Base_List_Table {
|
||||
* Secure (HTTPS)
|
||||
*/
|
||||
'secure' => [
|
||||
'label' => __('HTTPS', 'wp-ultimo'),
|
||||
'label' => __('HTTPS', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
0 => __('Non-HTTPS', 'wp-ultimo'),
|
||||
1 => __('HTTPS', 'wp-ultimo'),
|
||||
0 => __('Non-HTTPS', 'wp-multisite-waas'),
|
||||
1 => __('HTTPS', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
|
||||
@ -218,7 +218,7 @@ class Domain_List_Table extends Base_List_Table {
|
||||
* Stage
|
||||
*/
|
||||
'stage' => [
|
||||
'label' => __('Verification Stage', 'wp-ultimo'),
|
||||
'label' => __('Verification Stage', 'wp-multisite-waas'),
|
||||
'options' => Domain_Stage::to_array(),
|
||||
],
|
||||
|
||||
|
@ -36,8 +36,8 @@ class Email_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Email', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Emails', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Email', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Emails', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_network_admin_url('wp-ultimo-edit-email'),
|
||||
@ -110,9 +110,9 @@ class Email_List_Table extends Base_List_Table {
|
||||
$content = wp_trim_words(wp_strip_all_tags($item->get_content()), 6);
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-email', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'duplicate' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-email', $url_atts), __('Duplicate', 'wp-ultimo')),
|
||||
'send-test' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Send Test Email', 'wp-ultimo'), wu_get_form_url('send_new_test', $url_atts), __('Send Test Email', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-email', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'duplicate' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-email', $url_atts), __('Duplicate', 'wp-multisite-waas')),
|
||||
'send-test' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Send Test Email', 'wp-multisite-waas'), wu_get_form_url('send_new_test', $url_atts), __('Send Test Email', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
$slug = $item->get_slug();
|
||||
@ -120,10 +120,10 @@ class Email_List_Table extends Base_List_Table {
|
||||
$default_system_emails = wu_get_default_system_emails();
|
||||
|
||||
if (isset($default_system_emails[ $slug ])) {
|
||||
$actions['reset'] = sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Reset', 'wp-ultimo'), wu_get_form_url('reset_confirmation', $url_atts), __('Reset', 'wp-ultimo'));
|
||||
$actions['reset'] = sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Reset', 'wp-multisite-waas'), wu_get_form_url('reset_confirmation', $url_atts), __('Reset', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$actions['delete'] = sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo'));
|
||||
$actions['delete'] = sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-multisite-waas'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-multisite-waas'));
|
||||
|
||||
return $title . $content . $this->row_actions($actions);
|
||||
}
|
||||
@ -172,12 +172,12 @@ class Email_List_Table extends Base_List_Table {
|
||||
if ($item->get_schedule_type() === 'hours') {
|
||||
$time = explode(':', (string) $item->get_send_hours());
|
||||
|
||||
$text = sprintf(__('%1$s hour(s) and %2$s minute(s) after the event.', 'wp-ultimo'), $time[0], $time[1]);
|
||||
$text = sprintf(__('%1$s hour(s) and %2$s minute(s) after the event.', 'wp-multisite-waas'), $time[0], $time[1]);
|
||||
} elseif ($item->get_schedule_type() === 'days') {
|
||||
$text = sprintf(__('%s day(s) after the event.', 'wp-ultimo'), $item->get_send_days());
|
||||
$text = sprintf(__('%s day(s) after the event.', 'wp-multisite-waas'), $item->get_send_days());
|
||||
}
|
||||
} else {
|
||||
$text = __('Sent immediately after the event.', 'wp-ultimo');
|
||||
$text = __('Sent immediately after the event.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return $text;
|
||||
@ -193,11 +193,11 @@ class Email_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __('Content', 'wp-ultimo'),
|
||||
'slug' => __('Event', 'wp-ultimo'),
|
||||
'event' => __('slug', 'wp-ultimo'),
|
||||
'schedule' => __('When', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'title' => __('Content', 'wp-multisite-waas'),
|
||||
'slug' => __('Event', 'wp-multisite-waas'),
|
||||
'event' => __('slug', 'wp-multisite-waas'),
|
||||
'schedule' => __('When', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -219,14 +219,14 @@ class Email_List_Table extends Base_List_Table {
|
||||
$email = wu_get_email($email_id);
|
||||
|
||||
if ( ! $email) {
|
||||
WP_Ultimo()->notices->add(__('Email not found.', 'wp-ultimo'), 'error', 'network-admin');
|
||||
WP_Ultimo()->notices->add(__('Email not found.', 'wp-multisite-waas'), 'error', 'network-admin');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$new_email = $email->duplicate();
|
||||
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-ultimo'), $email->get_name());
|
||||
// translators: the %s is the thing copied.
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-multisite-waas'), $email->get_name());
|
||||
|
||||
$new_email->set_name($new_name);
|
||||
|
||||
@ -276,7 +276,7 @@ class Email_List_Table extends Base_List_Table {
|
||||
]
|
||||
);
|
||||
|
||||
wp_redirect($redirect_url);
|
||||
wp_safe_redirect($redirect_url);
|
||||
|
||||
exit;
|
||||
}
|
||||
@ -292,16 +292,16 @@ class Email_List_Table extends Base_List_Table {
|
||||
return [
|
||||
'filters' => [
|
||||
'type' => [
|
||||
'label' => __('Email Type', 'wp-ultimo'),
|
||||
'label' => __('Email Type', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'email_email' => __('Email', 'wp-ultimo'),
|
||||
'broadcast_email' => __('Notices', 'wp-ultimo'),
|
||||
'email_email' => __('Email', 'wp-multisite-waas'),
|
||||
'broadcast_email' => __('Notices', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
],
|
||||
'date_filters' => [
|
||||
'date_created' => [
|
||||
'label' => __('Date', 'wp-ultimo'),
|
||||
'label' => __('Date', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
],
|
||||
@ -320,19 +320,19 @@ class Email_List_Table extends Base_List_Table {
|
||||
'all' => [
|
||||
'field' => 'target',
|
||||
'url' => add_query_arg('target', 'all'),
|
||||
'label' => __('All Emails', 'wp-ultimo'),
|
||||
'label' => __('All Emails', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'admin' => [
|
||||
'field' => 'target',
|
||||
'url' => add_query_arg('target', 'admin'),
|
||||
'label' => __('Admin Emails', 'wp-ultimo'),
|
||||
'label' => __('Admin Emails', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'customer' => [
|
||||
'field' => 'target',
|
||||
'url' => add_query_arg('target', 'customer'),
|
||||
'label' => __('Customer Emails', 'wp-ultimo'),
|
||||
'label' => __('Customer Emails', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
@ -38,8 +38,8 @@ class Event_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Event', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Events', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Event', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Events', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
]
|
||||
);
|
||||
@ -93,7 +93,7 @@ class Event_List_Table extends Base_List_Table {
|
||||
</div>
|
||||
<div class=''>
|
||||
<strong class='wu-block'>{$system_text}</strong>
|
||||
<small>" . __('Automatically started', 'wp-ultimo') . "</small>
|
||||
<small>" . __('Automatically started', 'wp-multisite-waas') . "</small>
|
||||
</div>
|
||||
</div>";
|
||||
// phpcs:enable
|
||||
@ -137,7 +137,7 @@ class Event_List_Table extends Base_List_Table {
|
||||
</div>
|
||||
</a>";
|
||||
} else {
|
||||
$not_found = __('No initiator found', 'wp-ultimo');
|
||||
$not_found = __('No initiator found', 'wp-multisite-waas');
|
||||
|
||||
$html = "<div class='wu-table-card wu-text-gray-700 wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -182,15 +182,15 @@ class Event_List_Table extends Base_List_Table {
|
||||
];
|
||||
|
||||
$actions = [
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-view-event', $url_atts), __('View', 'wp-ultimo')),
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-view-event', $url_atts), __('View', 'wp-multisite-waas')),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
$url_atts
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -207,12 +207,12 @@ class Event_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'initiator' => __('Initiator', 'wp-ultimo'),
|
||||
'message' => __('Event Message', 'wp-ultimo'),
|
||||
'slug' => __('SLug', 'wp-ultimo'),
|
||||
'object_type' => __('Type', 'wp-ultimo'),
|
||||
'date_created' => __('Created at', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'initiator' => __('Initiator', 'wp-multisite-waas'),
|
||||
'message' => __('Event Message', 'wp-multisite-waas'),
|
||||
'slug' => __('SLug', 'wp-multisite-waas'),
|
||||
'object_type' => __('Type', 'wp-multisite-waas'),
|
||||
'date_created' => __('Created at', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return apply_filters('wu_events_list_table_get_columns', $columns, $this);
|
||||
@ -228,19 +228,19 @@ class Event_List_Table extends Base_List_Table {
|
||||
return [
|
||||
'filters' => [
|
||||
'severity' => [
|
||||
'label' => __('Severity', 'wp-ultimo'),
|
||||
'label' => __('Severity', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
Event::SEVERITY_SUCCESS => __('Success', 'wp-ultimo'),
|
||||
Event::SEVERITY_NEUTRAL => __('Neutral', 'wp-ultimo'),
|
||||
Event::SEVERITY_INFO => __('Info', 'wp-ultimo'),
|
||||
Event::SEVERITY_WARNING => __('Warning', 'wp-ultimo'),
|
||||
Event::SEVERITY_FATAL => __('Fatal', 'wp-ultimo'),
|
||||
Event::SEVERITY_SUCCESS => __('Success', 'wp-multisite-waas'),
|
||||
Event::SEVERITY_NEUTRAL => __('Neutral', 'wp-multisite-waas'),
|
||||
Event::SEVERITY_INFO => __('Info', 'wp-multisite-waas'),
|
||||
Event::SEVERITY_WARNING => __('Warning', 'wp-multisite-waas'),
|
||||
Event::SEVERITY_FATAL => __('Fatal', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
],
|
||||
'date_filters' => [
|
||||
'date_created' => [
|
||||
'label' => __('Created At', 'wp-ultimo'),
|
||||
'label' => __('Created At', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
],
|
||||
|
@ -47,12 +47,12 @@ class Inside_Events_List_Table extends Event_List_Table {
|
||||
$first_row = [
|
||||
'id' => [
|
||||
'icon' => 'dashicons-wu-hash wu-align-middle wu-mr-1',
|
||||
'label' => __('Event ID', 'wp-ultimo'),
|
||||
'label' => __('Event ID', 'wp-multisite-waas'),
|
||||
'value' => $item->get_id(),
|
||||
],
|
||||
'slug' => [
|
||||
'icon' => 'dashicons-wu-bookmark1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Event Type', 'wp-ultimo'),
|
||||
'label' => __('Event Type', 'wp-multisite-waas'),
|
||||
'value' => wu_slug_to_name($item->get_slug()),
|
||||
],
|
||||
];
|
||||
@ -60,7 +60,7 @@ class Inside_Events_List_Table extends Event_List_Table {
|
||||
$object_initiator = $item->get_initiator();
|
||||
|
||||
if ('system' === $object_initiator) {
|
||||
$value = sprintf('<span class="dashicons-wu-wp-ultimo wu-align-middle wu-mr-1 wu-text-lg"></span><span class="wu-text-gray-600">%s</span>', __('Automatically processed by WP Multisite WaaS', 'wp-ultimo'));
|
||||
$value = sprintf('<span class="dashicons-wu-wp-ultimo wu-align-middle wu-mr-1 wu-text-lg"></span><span class="wu-text-gray-600">%s</span>', __('Automatically processed by WP Multisite WaaS', 'wp-multisite-waas'));
|
||||
} elseif ('manual' === $object_initiator) {
|
||||
$avatar = get_avatar(
|
||||
$item->get_author_id(),
|
||||
@ -95,7 +95,7 @@ class Inside_Events_List_Table extends Event_List_Table {
|
||||
'date_created' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => sprintf(__('Processed %s', 'wp-ultimo'), wu_human_time_diff($item->get_date_created(), '-1 day')),
|
||||
'value' => sprintf(__('Processed %s', 'wp-multisite-waas'), wu_human_time_diff($item->get_date_created(), '-1 day')),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -36,8 +36,8 @@ class Line_Item_List_Table extends Payment_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Line Item', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Line Items', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Line Item', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Line Items', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
]
|
||||
);
|
||||
@ -99,8 +99,8 @@ class Line_Item_List_Table extends Payment_List_Table {
|
||||
];
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Edit Item', 'wp-ultimo'), wu_get_form_url('edit_line_item', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete Item', 'wp-ultimo'), wu_get_form_url('delete_line_item', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Edit Item', 'wp-multisite-waas'), wu_get_form_url('edit_line_item', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete Item', 'wp-multisite-waas'), wu_get_form_url('delete_line_item', $url_atts), __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
$html = sprintf('<span class="wu-block wu-text-gray-700">%s</span>', $item->get_title());
|
||||
@ -122,7 +122,7 @@ class Line_Item_List_Table extends Payment_List_Table {
|
||||
|
||||
$html = wu_format_currency($item->get_unit_price());
|
||||
|
||||
$quantity = sprintf(__('Quantity: %s', 'wp-ultimo'), $item->get_quantity()); // phpcs:ignore
|
||||
$quantity = sprintf(__('Quantity: %s', 'wp-multisite-waas'), $item->get_quantity()); // phpcs:ignore
|
||||
|
||||
return $html . sprintf('<small class="wu-block">%s</small>', $quantity);
|
||||
}
|
||||
@ -145,7 +145,7 @@ class Line_Item_List_Table extends Payment_List_Table {
|
||||
$tax_rate = $item->get_tax_rate() . '%';
|
||||
}
|
||||
|
||||
$tax_label = $item->get_tax_rate() ? ($item->get_tax_label() ?: __('Tax Applied', 'wp-ultimo')) : __('No Taxes Applied', 'wp-ultimo');
|
||||
$tax_label = $item->get_tax_rate() ? ($item->get_tax_label() ?: __('Tax Applied', 'wp-multisite-waas')) : __('No Taxes Applied', 'wp-multisite-waas');
|
||||
|
||||
return $html . sprintf('<small class="wu-block">%s (%s)</small>', $tax_rate, $tax_label);
|
||||
}
|
||||
@ -168,7 +168,7 @@ class Line_Item_List_Table extends Payment_List_Table {
|
||||
$tax_rate = $item->get_discount_rate() . '%';
|
||||
}
|
||||
|
||||
$tax_label = $item->get_discount_rate() ? ($item->get_discount_label() ?: __('Discount', 'wp-ultimo')) : __('No discount', 'wp-ultimo');
|
||||
$tax_label = $item->get_discount_rate() ? ($item->get_discount_label() ?: __('Discount', 'wp-multisite-waas')) : __('No discount', 'wp-multisite-waas');
|
||||
|
||||
return $html . sprintf('<small class="wu-block">%s (%s)</small>', $tax_rate, $tax_label);
|
||||
}
|
||||
@ -208,12 +208,12 @@ class Line_Item_List_Table extends Payment_List_Table {
|
||||
public function get_columns() {
|
||||
|
||||
$columns = [
|
||||
'service' => __('Service', 'wp-ultimo'),
|
||||
'unit_price' => __('Unit Price', 'wp-ultimo'),
|
||||
'discounts_total' => __('discounts', 'wp-ultimo'),
|
||||
'subtotal' => __('Subtotal', 'wp-ultimo'),
|
||||
'tax_total' => __('Taxes', 'wp-ultimo'),
|
||||
'total' => __('Total', 'wp-ultimo'),
|
||||
'service' => __('Service', 'wp-multisite-waas'),
|
||||
'unit_price' => __('Unit Price', 'wp-multisite-waas'),
|
||||
'discounts_total' => __('discounts', 'wp-multisite-waas'),
|
||||
'subtotal' => __('Subtotal', 'wp-multisite-waas'),
|
||||
'tax_total' => __('Taxes', 'wp-multisite-waas'),
|
||||
'total' => __('Total', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -42,7 +42,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
* @param integer $per_page Items per page. This gets overridden as well.
|
||||
* @param integer $page_number The page number.
|
||||
* @param boolean $count Return as count or not.
|
||||
* @return array
|
||||
* @return array|int
|
||||
*/
|
||||
public function get_items($per_page = 5, $page_number = 1, $count = false) {
|
||||
|
||||
@ -74,19 +74,20 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
$item = $item['product'];
|
||||
|
||||
if ( ! $item) {
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'url' => false,
|
||||
'id' => 'not-found',
|
||||
'title' => __('Product not found', 'wp-ultimo'),
|
||||
'title' => __('Product not found', 'wp-multisite-waas'),
|
||||
'status' => '',
|
||||
'image' => $this->column_featured_image_id(new \WP_Ultimo\Models\Product()),
|
||||
],
|
||||
[
|
||||
'quantity' => [
|
||||
'icon' => 'dashicons-wu-package wu-align-middle wu-mr-1',
|
||||
'label' => __('Quantity', 'wp-ultimo'),
|
||||
'value' => sprintf(__('x%d', 'wp-ultimo'), $quantity),
|
||||
'label' => __('Quantity', 'wp-multisite-waas'),
|
||||
// translators: %d is a quantity number
|
||||
'value' => sprintf(__('x%d', 'wp-multisite-waas'), $quantity),
|
||||
],
|
||||
]
|
||||
);
|
||||
@ -97,12 +98,13 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
$first_row = [
|
||||
'quantity' => [
|
||||
'icon' => 'dashicons-wu-package wu-align-middle wu-mr-1',
|
||||
'label' => __('Quantity', 'wp-ultimo'),
|
||||
'value' => sprintf(__('x%d', 'wp-ultimo'), $quantity),
|
||||
'label' => __('Quantity', 'wp-multisite-waas'),
|
||||
// translators: %d = quantity
|
||||
'value' => sprintf(__('x%d', 'wp-multisite-waas'), $quantity),
|
||||
],
|
||||
'total' => [
|
||||
'icon' => 'dashicons-wu-shopping-bag1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Price description', 'wp-ultimo'),
|
||||
'label' => __('Price description', 'wp-multisite-waas'),
|
||||
'value' => $item->get_price_description(),
|
||||
],
|
||||
];
|
||||
@ -110,7 +112,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
$second_row = [
|
||||
'slug' => [
|
||||
'icon' => 'dashicons-wu-bookmark1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Product Slug', 'wp-ultimo'),
|
||||
'label' => __('Product Slug', 'wp-multisite-waas'),
|
||||
'value' => $item->get_slug(),
|
||||
],
|
||||
];
|
||||
@ -120,7 +122,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
'wrapper_classes' => 'wubox',
|
||||
'icon' => 'dashicons-wu-edit1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => __('Upgrade or Downgrade', 'wp-ultimo'),
|
||||
'value' => __('Upgrade or Downgrade', 'wp-multisite-waas'),
|
||||
'url' => wu_get_form_url(
|
||||
'change_membership_plan',
|
||||
[
|
||||
@ -134,7 +136,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
'wrapper_classes' => 'wu-text-red-500 wubox',
|
||||
'icon' => 'dashicons-wu-trash-2 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => __('Remove', 'wp-ultimo'),
|
||||
'value' => __('Remove', 'wp-multisite-waas'),
|
||||
'url' => wu_get_form_url(
|
||||
'remove_membership_product',
|
||||
[
|
||||
@ -145,7 +147,7 @@ class Membership_Line_Item_List_Table extends Product_List_Table {
|
||||
];
|
||||
}
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'id' => $item->get_id(),
|
||||
'title' => $item->get_name(),
|
||||
|
@ -38,8 +38,8 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Membership', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Memberships', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Membership', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Memberships', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
]
|
||||
);
|
||||
@ -104,10 +104,7 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
*/
|
||||
public function get_extra_query_fields() {
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
|
||||
$search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : false;
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
$_filter_fields['customer_id'] = wu_request('customer_id');
|
||||
|
||||
return $_filter_fields;
|
||||
@ -129,8 +126,8 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
$code = sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-membership', $url_atts), $item->get_hash());
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-membership', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a href="%s">%s</a>', '', __('Delete', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-membership', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf('<a href="%s">%s</a>', '', __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
$html = "<span class='wu-font-mono'><strong>{$code}</strong></span>";
|
||||
@ -143,7 +140,7 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Membership $item Membership object.
|
||||
* @param \WP_Ultimo\Models\Membership $item Membership object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_status($item) {
|
||||
@ -160,13 +157,13 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Membership $item Membership object.
|
||||
* @param \WP_Ultimo\Models\Membership $item Membership object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_amount($item) {
|
||||
|
||||
if (empty($item->get_amount())) {
|
||||
return __('Free', 'wp-ultimo');
|
||||
return __('Free', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$amount = wu_format_currency($item->get_amount(), $item->get_currency());
|
||||
@ -176,7 +173,7 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
|
||||
$message = sprintf(
|
||||
// translators: %1$s is the formatted price, %2$s the duration, and %3$s the duration unit (day, week, month, etc)
|
||||
_n('every %2$s', 'every %1$s %2$s', $duration, 'wp-ultimo'), // phpcs:ignore
|
||||
_n('every %2$s', 'every %1$s %2$s', $duration, 'wp-multisite-waas'), // phpcs:ignore
|
||||
$duration,
|
||||
$item->get_duration_unit()
|
||||
);
|
||||
@ -184,14 +181,14 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
if ( ! $item->is_forever_recurring()) {
|
||||
$billing_cycles_message = sprintf(
|
||||
// translators: %s is the number of billing cycles.
|
||||
_n('for %s cycle', 'for %s cycles', $item->get_billing_cycles(), 'wp-ultimo'),
|
||||
_n('for %s cycle', 'for %s cycles', $item->get_billing_cycles(), 'wp-multisite-waas'),
|
||||
$item->get_billing_cycles()
|
||||
);
|
||||
|
||||
$message .= ' ' . $billing_cycles_message;
|
||||
}
|
||||
} else {
|
||||
$message = __('one time payment', 'wp-ultimo');
|
||||
$message = __('one time payment', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return sprintf('%s<br><small>%s</small>', $amount, $message);
|
||||
@ -210,7 +207,7 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
$customer = $item->get_customer();
|
||||
|
||||
if ( ! $customer) {
|
||||
$not_found = __('No customer found', 'wp-ultimo');
|
||||
$not_found = __('No customer found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-py-1 wu-px-2 wu-flex-grow wu-block wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-bg-gray-100 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -262,10 +259,10 @@ class Membership_List_Table_Widget extends Base_List_Table {
|
||||
public function get_columns() {
|
||||
|
||||
$columns = [
|
||||
'hash' => __('Ref.', 'wp-ultimo'),
|
||||
'status' => __('Status', 'wp-ultimo'),
|
||||
'customer' => __('Customer', 'wp-ultimo'),
|
||||
'amount' => __('Price', 'wp-ultimo'),
|
||||
'hash' => __('Ref.', 'wp-multisite-waas'),
|
||||
'status' => __('Status', 'wp-multisite-waas'),
|
||||
'customer' => __('Customer', 'wp-multisite-waas'),
|
||||
'amount' => __('Price', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -36,8 +36,8 @@ class Membership_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Membership', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Memberships', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Membership', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Memberships', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_membership'),
|
||||
@ -55,10 +55,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function get_extra_query_fields() {
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
|
||||
$search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : false;
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
$_filter_fields['customer_id'] = wu_request('customer_id');
|
||||
|
||||
return $_filter_fields;
|
||||
@ -82,15 +79,15 @@ class Membership_List_Table extends Base_List_Table {
|
||||
$code = sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-membership', $url_atts), $item->get_hash());
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-membership', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-membership', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
$url_atts
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -129,7 +126,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
public function column_amount($item) {
|
||||
|
||||
if (empty($item->get_amount()) && empty($item->get_initial_amount())) {
|
||||
return __('Free', 'wp-ultimo');
|
||||
return __('Free', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
if ($item->is_recurring()) {
|
||||
@ -139,7 +136,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
|
||||
$message = sprintf(
|
||||
// translators: %1$s is the formatted price, %2$s the duration, and %3$s the duration unit (day, week, month, etc)
|
||||
_n('every %2$s', 'every %1$s %2$s', $duration, 'wp-ultimo'), // phpcs:ignore
|
||||
_n('every %2$s', 'every %1$s %2$s', $duration, 'wp-multisite-waas'), // phpcs:ignore
|
||||
$duration,
|
||||
$item->get_duration_unit()
|
||||
);
|
||||
@ -147,7 +144,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
if ( ! $item->is_forever_recurring()) {
|
||||
$billing_cycles_message = sprintf(
|
||||
// translators: %s is the number of billing cycles.
|
||||
_n('for %s cycle', 'for %s cycles', $item->get_billing_cycles(), 'wp-ultimo'),
|
||||
_n('for %s cycle', 'for %s cycles', $item->get_billing_cycles(), 'wp-multisite-waas'),
|
||||
$item->get_billing_cycles()
|
||||
);
|
||||
|
||||
@ -156,7 +153,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
} else {
|
||||
$amount = wu_format_currency($item->get_initial_amount(), $item->get_currency());
|
||||
|
||||
$message = __('one time payment', 'wp-ultimo');
|
||||
$message = __('one time payment', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return sprintf('%s<br><small>%s</small>', $amount, $message);
|
||||
@ -172,15 +169,14 @@ class Membership_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'hash' => wu_tooltip(__('Reference Code', 'wp-ultimo'), 'dashicons-wu-hash wu-text-xs'),
|
||||
'status' => __('Status', 'wp-ultimo'),
|
||||
'customer' => __('Customer', 'wp-ultimo'),
|
||||
'product' => __('Product', 'wp-ultimo'),
|
||||
'amount' => __('Price', 'wp-ultimo'),
|
||||
// 'sites' => __('Sites', 'wp-ultimo'),
|
||||
'date_created' => __('Created at', 'wp-ultimo'),
|
||||
'date_expiration' => __('Expiration', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'hash' => wu_tooltip(__('Reference Code', 'wp-multisite-waas'), 'dashicons-wu-hash wu-text-xs'),
|
||||
'status' => __('Status', 'wp-multisite-waas'),
|
||||
'customer' => __('Customer', 'wp-multisite-waas'),
|
||||
'product' => __('Product', 'wp-multisite-waas'),
|
||||
'amount' => __('Price', 'wp-multisite-waas'),
|
||||
'date_created' => __('Created at', 'wp-multisite-waas'),
|
||||
'date_expiration' => __('Expiration', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -199,18 +195,18 @@ class Membership_List_Table extends Base_List_Table {
|
||||
$date = $item->get_date_expiration();
|
||||
|
||||
if (empty($date) || '0000-00-00 00:00:00' === $date) {
|
||||
return sprintf('<span>%s</span><br><small>%s</small>', __('Lifetime', 'wp-ultimo'), __('It never expires', 'wp-ultimo'));
|
||||
return sprintf('<span>%s</span><br><small>%s</small>', __('Lifetime', 'wp-multisite-waas'), __('It never expires', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
if ( ! wu_validate_date($date)) {
|
||||
return __('--', 'wp-ultimo');
|
||||
return __('--', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$time = strtotime(get_date_from_gmt($date));
|
||||
|
||||
$formatted_value = date_i18n(get_option('date_format'), $time);
|
||||
|
||||
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
|
||||
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-multisite-waas') : __('In %s', 'wp-multisite-waas'); // phpcs:ignore
|
||||
|
||||
$text = $formatted_value . sprintf('<br><small>%s</small>', sprintf($placeholder, human_time_diff($time)));
|
||||
|
||||
@ -233,7 +229,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
* Status
|
||||
*/
|
||||
'status' => [
|
||||
'label' => __('Status', 'wp-ultimo'),
|
||||
'label' => __('Status', 'wp-multisite-waas'),
|
||||
'options' => $membership_status::to_array(),
|
||||
],
|
||||
|
||||
@ -244,7 +240,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
* Created At
|
||||
*/
|
||||
'date_created' => [
|
||||
'label' => __('Created At', 'wp-ultimo'),
|
||||
'label' => __('Created At', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
|
||||
@ -252,7 +248,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
* Expiration Date
|
||||
*/
|
||||
'date_expiration' => [
|
||||
'label' => __('Expiration Date', 'wp-ultimo'),
|
||||
'label' => __('Expiration Date', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
|
||||
@ -260,7 +256,7 @@ class Membership_List_Table extends Base_List_Table {
|
||||
* Renewal Date
|
||||
*/
|
||||
'date_renewed' => [
|
||||
'label' => __('Renewal Date', 'wp-ultimo'),
|
||||
'label' => __('Renewal Date', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
],
|
||||
@ -279,43 +275,43 @@ class Membership_List_Table extends Base_List_Table {
|
||||
'all' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'all'),
|
||||
'label' => __('All Memberships', 'wp-ultimo'),
|
||||
'label' => __('All Memberships', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'active' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'active'),
|
||||
'label' => __('Active', 'wp-ultimo'),
|
||||
'label' => __('Active', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'trialing' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'trialing'),
|
||||
'label' => __('Trialing', 'wp-ultimo'),
|
||||
'label' => __('Trialing', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'pending' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'pending'),
|
||||
'label' => __('Pending', 'wp-ultimo'),
|
||||
'label' => __('Pending', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'on-hold' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'on-hold'),
|
||||
'label' => __('On Hold', 'wp-ultimo'),
|
||||
'label' => __('On Hold', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'expired' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'expired'),
|
||||
'label' => __('Expired', 'wp-ultimo'),
|
||||
'label' => __('Expired', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'cancelled' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'cancelled'),
|
||||
'label' => __('Cancelled', 'wp-ultimo'),
|
||||
'label' => __('Cancelled', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
@ -44,9 +44,9 @@ class Memberships_Site_List_Table extends Customers_Site_List_Table {
|
||||
*/
|
||||
public function column_responsive($item): void {
|
||||
|
||||
$redirect = current_user_can('wu_edit_sites') ? 'wp-ultimo-edit-site' : 'wp-ultimo-sites';
|
||||
$redirect = current_user_can('edit_others_posts') ? 'wp-ultimo-edit-site' : 'wp-ultimo-sites';
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'id' => $item->get_id(),
|
||||
'title' => $item->get_title(),
|
||||
@ -62,14 +62,14 @@ class Memberships_Site_List_Table extends Customers_Site_List_Table {
|
||||
[
|
||||
'link' => [
|
||||
'icon' => 'dashicons-wu-link1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Visit Site', 'wp-ultimo'),
|
||||
'value' => __('Homepage', 'wp-ultimo'),
|
||||
'label' => __('Visit Site', 'wp-multisite-waas'),
|
||||
'value' => __('Homepage', 'wp-multisite-waas'),
|
||||
'url' => $item->get_active_site_url(),
|
||||
],
|
||||
'dashboard' => [
|
||||
'icon' => 'dashicons-wu-browser wu-align-middle wu-mr-1',
|
||||
'label' => __('Go to the Dashboard', 'wp-ultimo'),
|
||||
'value' => __('Dashboard', 'wp-ultimo'),
|
||||
'label' => __('Go to the Dashboard', 'wp-multisite-waas'),
|
||||
'value' => __('Dashboard', 'wp-multisite-waas'),
|
||||
'url' => get_admin_url($item->get_id()),
|
||||
],
|
||||
],
|
||||
@ -77,7 +77,7 @@ class Memberships_Site_List_Table extends Customers_Site_List_Table {
|
||||
'date_created' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => $item->get_type() === 'pending' ? __('Not Available', 'wp-ultimo') : sprintf(__('Created %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_registered()))),
|
||||
'value' => $item->get_type() === 'pending' ? __('Not Available', 'wp-multisite-waas') : sprintf(__('Created %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_registered()))),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -49,12 +49,12 @@ class Payment_Line_Item_List_Table extends Line_Item_List_Table {
|
||||
$first_row = [
|
||||
'quantity' => [
|
||||
'icon' => 'dashicons-wu-package wu-align-middle wu-mr-1',
|
||||
'label' => __('Quantity', 'wp-ultimo'),
|
||||
'value' => sprintf(__('x%d', 'wp-ultimo'), $item->get_quantity()),
|
||||
'label' => __('Quantity', 'wp-multisite-waas'),
|
||||
'value' => sprintf(__('x%d', 'wp-multisite-waas'), $item->get_quantity()),
|
||||
],
|
||||
'unit_price' => [
|
||||
'icon' => 'dashicons-wu-info1 wu-align-middle wu-mr-1',
|
||||
'label' => __('Unit Price', 'wp-ultimo'),
|
||||
'label' => __('Unit Price', 'wp-multisite-waas'),
|
||||
'value' => wu_format_currency($item->get_unit_price()),
|
||||
],
|
||||
];
|
||||
@ -70,7 +70,7 @@ class Payment_Line_Item_List_Table extends Line_Item_List_Table {
|
||||
'wrapper_classes' => 'wubox',
|
||||
'icon' => 'dashicons-wu-edit1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => __('Edit', 'wp-ultimo'),
|
||||
'value' => __('Edit', 'wp-multisite-waas'),
|
||||
'url' => wu_get_form_url('edit_line_item', $url_atts),
|
||||
];
|
||||
|
||||
@ -78,7 +78,7 @@ class Payment_Line_Item_List_Table extends Line_Item_List_Table {
|
||||
'wrapper_classes' => 'wu-text-red-500 wubox',
|
||||
'icon' => 'dashicons-wu-trash-2 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => __('Remove', 'wp-ultimo'),
|
||||
'value' => __('Remove', 'wp-multisite-waas'),
|
||||
'url' => wu_get_form_url('delete_line_item', $url_atts),
|
||||
];
|
||||
|
||||
@ -90,21 +90,22 @@ class Payment_Line_Item_List_Table extends Line_Item_List_Table {
|
||||
$tax_rate = $item->get_discount_rate() . '%';
|
||||
}
|
||||
|
||||
$tax_label = $item->get_discount_rate() ? ($item->get_discount_label() ?: __('Discount', 'wp-ultimo')) : __('No discount', 'wp-ultimo');
|
||||
$tax_label = $item->get_discount_rate() ? ($item->get_discount_label() ?: __('Discount', 'wp-multisite-waas')) : __('No discount', 'wp-multisite-waas');
|
||||
|
||||
$tooltip = sprintf('%s (%s)', $tax_rate, $tax_label);
|
||||
|
||||
$first_row['discounts_total'] = [
|
||||
'icon' => 'dashicons-wu-percent wu-align-middle wu-mr-1',
|
||||
'label' => $tooltip,
|
||||
'value' => sprintf(__('Discounts: %s', 'wp-ultimo'), wu_format_currency($item->get_discount_total())),
|
||||
'value' => sprintf(__('Discounts: %s', 'wp-multisite-waas'), wu_format_currency($item->get_discount_total())),
|
||||
];
|
||||
}
|
||||
|
||||
$first_row['subtotal'] = [
|
||||
'icon' => 'dashicons-wu-info1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => sprintf(__('Subtotal: %s', 'wp-ultimo'), wu_format_currency($item->get_subtotal())),
|
||||
/* translators: %s is a currency amount */
|
||||
'value' => sprintf(__('Subtotal: %s', 'wp-multisite-waas'), wu_format_currency($item->get_subtotal())),
|
||||
];
|
||||
|
||||
/*
|
||||
@ -115,24 +116,24 @@ class Payment_Line_Item_List_Table extends Line_Item_List_Table {
|
||||
$tax_rate = $item->get_tax_rate() . '%';
|
||||
}
|
||||
|
||||
$tax_label = $item->get_tax_rate() ? ($item->get_tax_label() ?: __('Tax Applied', 'wp-ultimo')) : __('No Taxes Applied', 'wp-ultimo');
|
||||
$tax_label = $item->get_tax_rate() ? ($item->get_tax_label() ?: __('Tax Applied', 'wp-multisite-waas')) : __('No Taxes Applied', 'wp-multisite-waas');
|
||||
|
||||
$tooltip = sprintf('%s (%s)', $tax_rate, $tax_label);
|
||||
|
||||
$first_row['tax_total'] = [
|
||||
'icon' => 'dashicons-wu-percent wu-align-middle wu-mr-1',
|
||||
'label' => $tooltip,
|
||||
'value' => sprintf(__('Taxes: %s', 'wp-ultimo'), wu_format_currency($item->get_tax_total())),
|
||||
'value' => sprintf(__('Taxes: %s', 'wp-multisite-waas'), wu_format_currency($item->get_tax_total())),
|
||||
];
|
||||
}
|
||||
|
||||
$first_row['description'] = [
|
||||
'icon' => 'dashicons-wu-file-text wu-align-middle wu-mr-1',
|
||||
'label' => __('Item Description', 'wp-ultimo'),
|
||||
'label' => __('Item Description', 'wp-multisite-waas'),
|
||||
'value' => $item->get_description(),
|
||||
];
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
echo wu_responsive_table_row( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
[
|
||||
'id' => '',
|
||||
'title' => $item->get_title(),
|
||||
|
@ -38,8 +38,8 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Payment', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Payments', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Payment', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Payments', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
]
|
||||
);
|
||||
@ -101,7 +101,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @param \WP_Ultimo\Models\Payment $item Payment object.
|
||||
*/
|
||||
public function column_hash($item): string {
|
||||
|
||||
@ -112,8 +112,8 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
$code = sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-payment', $url_atts), $item->get_hash());
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-payment', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a href="%s">%s</a>', '', __('Delete', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-payment', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf('<a href="%s">%s</a>', '', __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
$html = "<span class='wu-font-mono'><strong>{$code}</strong></span>";
|
||||
@ -126,7 +126,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @param \WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_status($item) {
|
||||
@ -144,7 +144,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Membership $item Membership object.
|
||||
* @param \WP_Ultimo\Models\Membership $item Membership object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_customer($item) {
|
||||
@ -152,7 +152,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
$customer = $item->get_customer();
|
||||
|
||||
if ( ! $customer) {
|
||||
$not_found = __('No customer found', 'wp-ultimo');
|
||||
$not_found = __('No customer found', 'wp-multisite-waas');
|
||||
|
||||
return "<div class='wu-py-1 wu-px-2 wu-flex wu-flex-grow wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300 wu-bg-gray-100 wu-relative wu-overflow-hidden'>
|
||||
<span class='dashicons dashicons-wu-block wu-text-gray-600 wu-px-1 wu-pr-3'> </span>
|
||||
@ -181,8 +181,6 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
|
||||
$id = $customer->get_id();
|
||||
|
||||
$email = $customer->get_email_address();
|
||||
|
||||
$customer_link = wu_network_admin_url('wp-ultimo-edit-customer', $url_atts);
|
||||
|
||||
$html = "<a href='{$customer_link}' class='wu-p-1 wu-flex wu-flex-grow wu-bg-gray-100 wu-rounded wu-items-center wu-border wu-border-solid wu-border-gray-300'>
|
||||
@ -200,7 +198,7 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @param \WP_Ultimo\Models\Payment $item Payment object.
|
||||
*/
|
||||
public function column_total($item): string {
|
||||
|
||||
@ -218,10 +216,10 @@ class Payment_List_Table_Widget extends Base_List_Table {
|
||||
public function get_columns() {
|
||||
|
||||
$columns = [
|
||||
'hash' => __('Ref.', 'wp-ultimo'),
|
||||
'customer' => __('Customer', 'wp-ultimo'),
|
||||
'total' => __('Total', 'wp-ultimo'),
|
||||
'date_created' => __('Created at', 'wp-ultimo'),
|
||||
'hash' => __('Ref.', 'wp-multisite-waas'),
|
||||
'customer' => __('Customer', 'wp-multisite-waas'),
|
||||
'total' => __('Total', 'wp-multisite-waas'),
|
||||
'date_created' => __('Created at', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -38,8 +38,8 @@ class Payment_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Payment', 'wp-ultimo'),
|
||||
'plural' => __('Payments', 'wp-ultimo'),
|
||||
'singular' => __('Payment', 'wp-multisite-waas'),
|
||||
'plural' => __('Payments', 'wp-multisite-waas'),
|
||||
'ajax' => true,
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_payment'),
|
||||
@ -57,14 +57,9 @@ class Payment_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function get_extra_query_fields() {
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
|
||||
$search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : false;
|
||||
|
||||
$_filter_fields = parent::get_extra_query_fields();
|
||||
$_filter_fields['membership_id'] = wu_request('membership_id', false);
|
||||
|
||||
$_filter_fields['customer_id'] = wu_request('customer_id', false);
|
||||
|
||||
$_filter_fields['customer_id'] = wu_request('customer_id', false);
|
||||
$_filter_fields['parent_id__in'] = ['0', 0, '', null];
|
||||
|
||||
return $_filter_fields;
|
||||
@ -75,7 +70,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @param \WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_hash($item) {
|
||||
@ -87,10 +82,10 @@ class Payment_List_Table extends Base_List_Table {
|
||||
$code = sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-payment', $url_atts), $item->get_hash());
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-payment', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-payment', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
[
|
||||
@ -98,7 +93,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
'id' => $item->get_id(),
|
||||
]
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -129,7 +124,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @param \WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_product($item) {
|
||||
@ -137,7 +132,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
$product = $item->get_product();
|
||||
|
||||
if ( ! $product) {
|
||||
return __('No product found', 'wp-ultimo');
|
||||
return __('No product found', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$url_atts = [
|
||||
@ -145,7 +140,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
];
|
||||
|
||||
$actions = [
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-product', $url_atts), __('View', 'wp-ultimo')),
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-product', $url_atts), __('View', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
$html = $product->get_name();
|
||||
@ -158,7 +153,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @param \WP_Ultimo\Models\Payment $item Payment object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_total($item) {
|
||||
@ -178,13 +173,13 @@ class Payment_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'hash' => wu_tooltip(__('Reference Code', 'wp-ultimo'), 'dashicons-wu-hash wu-text-xs'),
|
||||
'status' => __('Status', 'wp-ultimo'),
|
||||
'customer' => __('Customer', 'wp-ultimo'),
|
||||
'membership' => __('Membership', 'wp-ultimo'),
|
||||
'total' => __('Total', 'wp-ultimo'),
|
||||
'date_created' => __('Created at', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'hash' => wu_tooltip(__('Reference Code', 'wp-multisite-waas'), 'dashicons-wu-hash wu-text-xs'),
|
||||
'status' => __('Status', 'wp-multisite-waas'),
|
||||
'customer' => __('Customer', 'wp-multisite-waas'),
|
||||
'membership' => __('Membership', 'wp-multisite-waas'),
|
||||
'total' => __('Total', 'wp-multisite-waas'),
|
||||
'date_created' => __('Created at', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -204,13 +199,13 @@ class Payment_List_Table extends Base_List_Table {
|
||||
* Status
|
||||
*/
|
||||
'status' => [
|
||||
'label' => __('Status', 'wp-ultimo'),
|
||||
'label' => __('Status', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'pending' => __('Pending', 'wp-ultimo'),
|
||||
'completed' => __('Completed', 'wp-ultimo'),
|
||||
'refund' => __('Refund', 'wp-ultimo'),
|
||||
'partial' => __('Partial', 'wp-ultimo'),
|
||||
'failed' => __('Failed', 'wp-ultimo'),
|
||||
'pending' => __('Pending', 'wp-multisite-waas'),
|
||||
'completed' => __('Completed', 'wp-multisite-waas'),
|
||||
'refund' => __('Refund', 'wp-multisite-waas'),
|
||||
'partial' => __('Partial', 'wp-multisite-waas'),
|
||||
'failed' => __('Failed', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
|
||||
@ -218,12 +213,12 @@ class Payment_List_Table extends Base_List_Table {
|
||||
* Gateway
|
||||
*/
|
||||
'gateway' => [
|
||||
'label' => __('Gateway', 'wp-ultimo'),
|
||||
'label' => __('Gateway', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'free' => __('Free', 'wp-ultimo'),
|
||||
'manual' => __('Manual', 'wp-ultimo'),
|
||||
'paypal' => __('Paypal', 'wp-ultimo'),
|
||||
'stripe' => __('Stripe', 'wp-ultimo'),
|
||||
'free' => __('Free', 'wp-multisite-waas'),
|
||||
'manual' => __('Manual', 'wp-multisite-waas'),
|
||||
'paypal' => __('Paypal', 'wp-multisite-waas'),
|
||||
'stripe' => __('Stripe', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
],
|
||||
@ -233,7 +228,7 @@ class Payment_List_Table extends Base_List_Table {
|
||||
* Created At
|
||||
*/
|
||||
'date_created' => [
|
||||
'label' => __('Created At', 'wp-ultimo'),
|
||||
'label' => __('Created At', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
],
|
||||
@ -249,40 +244,40 @@ class Payment_List_Table extends Base_List_Table {
|
||||
public function get_views() {
|
||||
|
||||
return [
|
||||
'all' => [
|
||||
'all' => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', 'all'),
|
||||
'label' => __('All Payments', 'wp-ultimo'),
|
||||
'label' => __('All Payments', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
Payment_Status::COMPLETED() => [
|
||||
Payment_Status::COMPLETED => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', Payment_Status::COMPLETED()),
|
||||
'label' => __('Completed', 'wp-ultimo'),
|
||||
'url' => add_query_arg('status', Payment_Status::COMPLETED),
|
||||
'label' => __('Completed', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
Payment_Status::PENDING() => [
|
||||
Payment_Status::PENDING => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', Payment_Status::PENDING()),
|
||||
'label' => __('Pending', 'wp-ultimo'),
|
||||
'url' => add_query_arg('status', Payment_Status::PENDING),
|
||||
'label' => __('Pending', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
Payment_Status::PARTIAL_REFUND() => [
|
||||
Payment_Status::PARTIAL_REFUND => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', Payment_Status::PARTIAL_REFUND()),
|
||||
'label' => __('Partially Refunded', 'wp-ultimo'),
|
||||
'url' => add_query_arg('status', Payment_Status::PARTIAL_REFUND),
|
||||
'label' => __('Partially Refunded', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
Payment_Status::REFUND() => [
|
||||
Payment_Status::REFUND => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', Payment_Status::REFUND()),
|
||||
'label' => __('Refunded', 'wp-ultimo'),
|
||||
'url' => add_query_arg('status', Payment_Status::REFUND),
|
||||
'label' => __('Refunded', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
Payment_Status::FAILED() => [
|
||||
Payment_Status::FAILED => [
|
||||
'field' => 'status',
|
||||
'url' => add_query_arg('status', Payment_Status::FAILED()),
|
||||
'label' => __('Failed', 'wp-ultimo'),
|
||||
'url' => add_query_arg('status', Payment_Status::FAILED),
|
||||
'label' => __('Failed', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
@ -36,8 +36,8 @@ class Product_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Product', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Products', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Product', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Products', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_network_admin_url('wp-ultimo-edit-product'),
|
||||
@ -68,7 +68,7 @@ class Product_List_Table extends Base_List_Table {
|
||||
$title = "<strong>$title</strong>";
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-product', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-product', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'duplicate' => sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
wu_network_admin_url(
|
||||
@ -78,9 +78,9 @@ class Product_List_Table extends Base_List_Table {
|
||||
'id' => $item->get_id(),
|
||||
]
|
||||
),
|
||||
__('Duplicate', 'wp-ultimo')
|
||||
__('Duplicate', 'wp-multisite-waas')
|
||||
),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-multisite-waas'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $title . $this->row_actions($actions);
|
||||
@ -129,11 +129,11 @@ class Product_List_Table extends Base_List_Table {
|
||||
public function column_amount($item) {
|
||||
|
||||
if ($item->get_pricing_type() === 'contact_us') {
|
||||
return __('None', 'wp-ultimo') . sprintf('<br><small>%s</small>', __('Requires contact', 'wp-ultimo'));
|
||||
return __('None', 'wp-multisite-waas') . sprintf('<br><small>%s</small>', __('Requires contact', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
if (empty($item->get_amount())) {
|
||||
return __('Free', 'wp-ultimo');
|
||||
return __('Free', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
$amount = wu_format_currency($item->get_amount(), $item->get_currency());
|
||||
@ -143,7 +143,7 @@ class Product_List_Table extends Base_List_Table {
|
||||
|
||||
$message = sprintf(
|
||||
// translators: %1$s is the formatted price, %2$s the duration, and %3$s the duration unit (day, week, month, etc)
|
||||
_n('every %2$s', 'every %1$s %2$s', $duration, 'wp-ultimo'), // phpcs:ignore
|
||||
_n('every %2$s', 'every %1$s %2$s', $duration, 'wp-multisite-waas'), // phpcs:ignore
|
||||
$duration,
|
||||
$item->get_duration_unit()
|
||||
);
|
||||
@ -151,14 +151,14 @@ class Product_List_Table extends Base_List_Table {
|
||||
if ( ! $item->is_forever_recurring()) {
|
||||
$billing_cycles_message = sprintf(
|
||||
// translators: %s is the number of billing cycles.
|
||||
_n('for %s cycle', 'for %s cycles', $item->get_billing_cycles(), 'wp-ultimo'),
|
||||
_n('for %s cycle', 'for %s cycles', $item->get_billing_cycles(), 'wp-multisite-waas'),
|
||||
$item->get_billing_cycles()
|
||||
);
|
||||
|
||||
$message .= ' ' . $billing_cycles_message;
|
||||
}
|
||||
} else {
|
||||
$message = __('one time payment', 'wp-ultimo');
|
||||
$message = __('one time payment', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return sprintf('%s<br><small>%s</small>', $amount, $message);
|
||||
@ -175,11 +175,11 @@ class Product_List_Table extends Base_List_Table {
|
||||
public function column_setup_fee($item) {
|
||||
|
||||
if ($item->get_pricing_type() === 'contact_us') {
|
||||
return __('None', 'wp-ultimo') . sprintf('<br><small>%s</small>', __('Requires contact', 'wp-ultimo'));
|
||||
return __('None', 'wp-multisite-waas') . sprintf('<br><small>%s</small>', __('Requires contact', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
if ( ! $item->has_setup_fee()) {
|
||||
return __('No Setup Fee', 'wp-ultimo');
|
||||
return __('No Setup Fee', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
return wu_format_currency($item->get_setup_fee(), $item->get_currency());
|
||||
@ -201,14 +201,15 @@ class Product_List_Table extends Base_List_Table {
|
||||
$product = wu_get_product($product);
|
||||
|
||||
if ( ! $product) {
|
||||
WP_Ultimo()->notices->add(__('Product not found.', 'wp-ultimo'), 'error', 'network-admin');
|
||||
WP_Ultimo()->notices->add(__('Product not found.', 'wp-multisite-waas'), 'error', 'network-admin');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$new_product = $product->duplicate();
|
||||
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-ultimo'), $product->get_name());
|
||||
// translators: the %s is the thing copied.
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-multisite-waas'), $product->get_name());
|
||||
|
||||
$new_product->set_name($new_name);
|
||||
|
||||
@ -232,7 +233,7 @@ class Product_List_Table extends Base_List_Table {
|
||||
]
|
||||
);
|
||||
|
||||
wp_redirect($redirect_url);
|
||||
wp_safe_redirect($redirect_url);
|
||||
|
||||
exit;
|
||||
}
|
||||
@ -249,12 +250,12 @@ class Product_List_Table extends Base_List_Table {
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'featured_image_id' => '<span class="dashicons-wu-image"></span>',
|
||||
'name' => __('Name', 'wp-ultimo'),
|
||||
'type' => __('Type', 'wp-ultimo'),
|
||||
'slug' => __('Slug', 'wp-ultimo'),
|
||||
'amount' => __('Price', 'wp-ultimo'),
|
||||
'setup_fee' => __('Setup Fee', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'name' => __('Name', 'wp-multisite-waas'),
|
||||
'type' => __('Type', 'wp-multisite-waas'),
|
||||
'slug' => __('Slug', 'wp-multisite-waas'),
|
||||
'amount' => __('Price', 'wp-multisite-waas'),
|
||||
'setup_fee' => __('Setup Fee', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -303,25 +304,25 @@ class Product_List_Table extends Base_List_Table {
|
||||
'all' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'all'),
|
||||
'label' => __('All Products', 'wp-ultimo'),
|
||||
'label' => __('All Products', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'plan' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'plan'),
|
||||
'label' => __('Plans', 'wp-ultimo'),
|
||||
'label' => __('Plans', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'package' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'package'),
|
||||
'label' => __('Packages', 'wp-ultimo'),
|
||||
'label' => __('Packages', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'service' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'service'),
|
||||
'label' => __('Services', 'wp-ultimo'),
|
||||
'label' => __('Services', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
@ -56,10 +56,10 @@ class Site_Customer_List_Table extends Customer_List_Table {
|
||||
*/
|
||||
public function column_responsive($item): void {
|
||||
|
||||
$last_login = sprintf(__('Last login %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_last_login())));
|
||||
$last_login = sprintf(__('Last login %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_last_login())));
|
||||
|
||||
if ($item->is_online()) {
|
||||
$last_login = '<span class="wu-inline-block wu-mr-1 wu-rounded-full wu-h-2 wu-w-2 wu-bg-green-500"></span>' . __('Online', 'wp-ultimo');
|
||||
$last_login = '<span class="wu-inline-block wu-mr-1 wu-rounded-full wu-h-2 wu-w-2 wu-bg-green-500"></span>' . __('Online', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
echo wu_responsive_table_row(
|
||||
@ -87,20 +87,20 @@ class Site_Customer_List_Table extends Customer_List_Table {
|
||||
[
|
||||
'total' => [
|
||||
'icon' => 'dashicons-wu-at-sign wu-align-middle wu-mr-1',
|
||||
'label' => __('Email Address', 'wp-ultimo'),
|
||||
'label' => __('Email Address', 'wp-multisite-waas'),
|
||||
'value' => $item->get_email_address(),
|
||||
],
|
||||
],
|
||||
[
|
||||
'date_expiration' => [
|
||||
'icon' => $item->is_online() === false ? 'dashicons-wu-calendar1 wu-align-middle wu-mr-1' : '',
|
||||
'label' => __('Last Login', 'wp-ultimo'),
|
||||
'label' => __('Last Login', 'wp-multisite-waas'),
|
||||
'value' => $last_login,
|
||||
],
|
||||
'date_created' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => sprintf(__('Registered %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_registered()))),
|
||||
'value' => sprintf(__('Registered %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_registered()))),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -41,8 +41,8 @@ class Site_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Site', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Sites', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Site', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Sites', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_site'),
|
||||
@ -60,7 +60,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
* @param integer $per_page Number of items to display per page.
|
||||
* @param integer $page_number Current page.
|
||||
* @param boolean $count If we should count records or return the actual records.
|
||||
* @return array
|
||||
* @return array|int
|
||||
*/
|
||||
public function get_items($per_page = 5, $page_number = 1, $count = false) {
|
||||
|
||||
@ -96,7 +96,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
/**
|
||||
* Render the bulk edit checkbox.
|
||||
*
|
||||
* @param WP_Ultimo\Models\Site $item Site object.
|
||||
* @param \WP_Ultimo\Models\Site $item Site object.
|
||||
*/
|
||||
public function column_cb($item): string {
|
||||
|
||||
@ -129,24 +129,24 @@ class Site_List_Table extends Base_List_Table {
|
||||
$title = "<strong>$title</strong>";
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-site', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-site', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'duplicate' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Duplicate Site', 'wp-ultimo'),
|
||||
__('Duplicate Site', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'add_new_site',
|
||||
$url_atts
|
||||
),
|
||||
__('Duplicate', 'wp-ultimo')
|
||||
__('Duplicate', 'wp-multisite-waas')
|
||||
),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
$url_atts
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -154,22 +154,22 @@ class Site_List_Table extends Base_List_Table {
|
||||
$actions = [
|
||||
'duplicate' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Publish Site', 'wp-ultimo'),
|
||||
__('Publish Site', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'publish_pending_site',
|
||||
['membership_id' => $item->get_membership_id()]
|
||||
),
|
||||
__('Publish', 'wp-ultimo')
|
||||
__('Publish', 'wp-multisite-waas')
|
||||
),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
[
|
||||
'id' => $item->get_membership_id(),
|
||||
'model' => 'membership_meta_pending_site',
|
||||
'redirect_to' => urlencode(
|
||||
'redirect_to' => rawurlencode(
|
||||
(string) wu_network_admin_url(
|
||||
'wp-ultimo-sites',
|
||||
[
|
||||
@ -180,7 +180,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
),
|
||||
]
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
}
|
||||
@ -193,7 +193,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Site $item Site object.
|
||||
* @param \WP_Ultimo\Models\Site $item Site object.
|
||||
*/
|
||||
public function column_date_registered($item): string {
|
||||
|
||||
@ -207,7 +207,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Site $item Site object.
|
||||
* @param \WP_Ultimo\Models\Site $item Site object.
|
||||
* @return string
|
||||
*/
|
||||
public function column_blog_id($item) {
|
||||
@ -237,7 +237,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Site $item Site object.
|
||||
* @param \WP_Ultimo\Models\Site $item Site object.
|
||||
*/
|
||||
public function column_domains($item): string {
|
||||
|
||||
@ -253,7 +253,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
];
|
||||
|
||||
$actions = [
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-domains', $url_atts), __('View', 'wp-ultimo')),
|
||||
'view' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-domains', $url_atts), __('View', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $domain . $this->row_actions($actions);
|
||||
@ -270,12 +270,12 @@ class Site_List_Table extends Base_List_Table {
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'featured_image_id' => '<span class="dashicons-wu-image"></span>',
|
||||
'path' => __('URL', 'wp-ultimo'),
|
||||
'type' => __('Type', 'wp-ultimo'),
|
||||
'customer' => __('Customer', 'wp-ultimo'),
|
||||
'membership' => __('Membership', 'wp-ultimo'),
|
||||
'domains' => __('Domains', 'wp-ultimo'),
|
||||
'blog_id' => __('ID', 'wp-ultimo'),
|
||||
'path' => __('URL', 'wp-multisite-waas'),
|
||||
'type' => __('Type', 'wp-multisite-waas'),
|
||||
'customer' => __('Customer', 'wp-multisite-waas'),
|
||||
'membership' => __('Membership', 'wp-multisite-waas'),
|
||||
'domains' => __('Domains', 'wp-multisite-waas'),
|
||||
'blog_id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
@ -286,7 +286,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
*
|
||||
* @since 2.0.0
|
||||
*
|
||||
* @param WP_Ultimo\Models\Customer $item The customer being shown.
|
||||
* @param \WP_Ultimo\Models\Customer $item The customer being shown.
|
||||
* @return void
|
||||
*/
|
||||
public function single_row_grid($item): void {
|
||||
@ -310,20 +310,20 @@ class Site_List_Table extends Base_List_Table {
|
||||
return [
|
||||
'filters' => [
|
||||
'vip' => [
|
||||
'label' => __('VIP Status', 'wp-ultimo'),
|
||||
'label' => __('VIP Status', 'wp-multisite-waas'),
|
||||
'options' => [
|
||||
'0' => __('Regular Sites', 'wp-ultimo'),
|
||||
'1' => __('VIP Sites', 'wp-ultimo'),
|
||||
'0' => __('Regular Sites', 'wp-multisite-waas'),
|
||||
'1' => __('VIP Sites', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
],
|
||||
'date_filters' => [
|
||||
'last_login' => [
|
||||
'label' => __('Last Login', 'wp-ultimo'),
|
||||
'label' => __('Last Login', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
'date_registered' => [
|
||||
'label' => __('Site Since', 'wp-ultimo'),
|
||||
'label' => __('Site Since', 'wp-multisite-waas'),
|
||||
'options' => $this->get_default_date_filter_options(),
|
||||
],
|
||||
],
|
||||
@ -342,25 +342,25 @@ class Site_List_Table extends Base_List_Table {
|
||||
'all' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'all'),
|
||||
'label' => __('All Sites', 'wp-ultimo'),
|
||||
'label' => __('All Sites', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'customer_owned' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'customer_owned'),
|
||||
'label' => __('Customer-Owned', 'wp-ultimo'),
|
||||
'label' => __('Customer-Owned', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'site_template' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'site_template'),
|
||||
'label' => __('Templates', 'wp-ultimo'),
|
||||
'label' => __('Templates', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
'pending' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'pending'),
|
||||
'label' => __('Pending', 'wp-ultimo'),
|
||||
'label' => __('Pending', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
@ -374,10 +374,10 @@ class Site_List_Table extends Base_List_Table {
|
||||
public function get_bulk_actions() {
|
||||
|
||||
$actions = [
|
||||
'screenshot' => __('Take Screenshot', 'wp-ultimo'),
|
||||
'screenshot' => __('Take Screenshot', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
$actions[ wu_request('type', 'all') === 'pending' ? 'delete-pending' : 'delete' ] = __('Delete', 'wp-ultimo');
|
||||
$actions[ wu_request('type', 'all') === 'pending' ? 'delete-pending' : 'delete' ] = __('Delete', 'wp-multisite-waas');
|
||||
|
||||
return $actions;
|
||||
}
|
||||
@ -398,15 +398,13 @@ class Site_List_Table extends Base_List_Table {
|
||||
$site = wu_get_site($site_id);
|
||||
|
||||
if ( ! $site) {
|
||||
WP_Ultimo()->notices->add(__('Site not found.', 'wp-ultimo'), 'error', 'network-admin');
|
||||
WP_Ultimo()->notices->add(__('Site not found.', 'wp-multisite-waas'), 'error', 'network-admin');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$new_site = $site->duplicate();
|
||||
|
||||
$new_name = sprintf(__('Copy of %s', 'wp-ultimo'), $new_site->get_title());
|
||||
|
||||
$new_path = sprintf('%s%s', trim((string) $new_site->get_path(), '/'), 'copy');
|
||||
|
||||
$new_site->set_template_id($new_site->get_blog_id());
|
||||
@ -435,7 +433,7 @@ class Site_List_Table extends Base_List_Table {
|
||||
]
|
||||
);
|
||||
|
||||
wp_redirect($redirect_url);
|
||||
wp_safe_redirect($redirect_url);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
@ -60,20 +60,20 @@ class Sites_Domain_List_Table extends Domain_List_Table {
|
||||
'primary' => [
|
||||
'icon' => $item->is_primary_domain() ? 'dashicons-wu-filter_1 wu-align-text-bottom wu-mr-1' : 'dashicons-wu-plus-square wu-align-text-bottom wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => $item->is_primary_domain() ? __('Primary', 'wp-ultimo') : __('Alias', 'wp-ultimo'),
|
||||
'value' => $item->is_primary_domain() ? __('Primary', 'wp-multisite-waas') : __('Alias', 'wp-multisite-waas'),
|
||||
],
|
||||
'secure' => [
|
||||
'wrapper_classes' => $item->is_secure() ? 'wu-text-green-500' : '',
|
||||
'icon' => $item->is_secure() ? 'dashicons-wu-lock1 wu-align-text-bottom wu-mr-1' : 'dashicons-wu-lock1 wu-align-text-bottom wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => $item->is_secure() ? __('Secure (HTTPS)', 'wp-ultimo') : __('Not Secure (HTTP)', 'wp-ultimo'),
|
||||
'value' => $item->is_secure() ? __('Secure (HTTPS)', 'wp-multisite-waas') : __('Not Secure (HTTP)', 'wp-multisite-waas'),
|
||||
],
|
||||
],
|
||||
[
|
||||
'date_created' => [
|
||||
'icon' => 'dashicons-wu-calendar1 wu-align-middle wu-mr-1',
|
||||
'label' => '',
|
||||
'value' => sprintf(__('Created %s', 'wp-ultimo'), wu_human_time_diff(strtotime((string) $item->get_date_created()))),
|
||||
'value' => sprintf(__('Created %s', 'wp-multisite-waas'), wu_human_time_diff(strtotime((string) $item->get_date_created()))),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -36,8 +36,8 @@ class Webhook_List_Table extends Base_List_Table {
|
||||
|
||||
parent::__construct(
|
||||
[
|
||||
'singular' => __('Webhook', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Webhooks', 'wp-ultimo'), // plural name of the listed records
|
||||
'singular' => __('Webhook', 'wp-multisite-waas'), // singular name of the listed records
|
||||
'plural' => __('Webhooks', 'wp-multisite-waas'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_webhook_modal'),
|
||||
@ -67,20 +67,20 @@ class Webhook_List_Table extends Base_List_Table {
|
||||
wu_network_admin_url('wp-ultimo-edit-webhook', $url_atts),
|
||||
$item->get_name(),
|
||||
$item->get_id(),
|
||||
__('Sending Test..', 'wp-ultimo')
|
||||
__('Sending Test..', 'wp-multisite-waas')
|
||||
);
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-webhook', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'test' => sprintf('<a id="action_button" data-title="' . $item->get_name() . '" data-page="list" data-action="wu_send_test_event" data-event="' . $item->get_event() . '" data-object="' . $item->get_id() . '" data-url="%s" href="">%s</a>', $item->get_webhook_url(), __('Send Test', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-webhook', $url_atts), __('Edit', 'wp-multisite-waas')),
|
||||
'test' => sprintf('<a id="action_button" data-title="' . $item->get_name() . '" data-page="list" data-action="wu_send_test_event" data-event="' . $item->get_event() . '" data-object="' . $item->get_id() . '" data-url="%s" href="">%s</a>', $item->get_webhook_url(), __('Send Test', 'wp-multisite-waas')),
|
||||
'delete' => sprintf(
|
||||
'<a title="%s" class="wubox" href="%s">%s</a>',
|
||||
__('Delete', 'wp-ultimo'),
|
||||
__('Delete', 'wp-multisite-waas'),
|
||||
wu_get_form_url(
|
||||
'delete_modal',
|
||||
$url_atts
|
||||
),
|
||||
__('Delete', 'wp-ultimo')
|
||||
__('Delete', 'wp-multisite-waas')
|
||||
),
|
||||
];
|
||||
|
||||
@ -129,7 +129,7 @@ class Webhook_List_Table extends Base_List_Table {
|
||||
$count = $item->get_count();
|
||||
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', '', __('See Events', 'wp-ultimo')),
|
||||
'edit' => sprintf('<a href="%s">%s</a>', '', __('See Events', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $count . $this->row_actions($actions);
|
||||
@ -157,7 +157,7 @@ class Webhook_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function column_active($item) {
|
||||
|
||||
return $item->is_active() ? __('Yes', 'wp-ultimo') : __('No', 'wp-ultimo');
|
||||
return $item->is_active() ? __('Yes', 'wp-multisite-waas') : __('No', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,13 +170,13 @@ class Webhook_List_Table extends Base_List_Table {
|
||||
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'name' => __('Name', 'wp-ultimo'),
|
||||
'webhook_url' => __('Target URL', 'wp-ultimo'),
|
||||
'event' => __('Trigger Event', 'wp-ultimo'),
|
||||
'event_count' => __('Count', 'wp-ultimo'),
|
||||
'integration' => __('Integration', 'wp-ultimo'),
|
||||
'active' => __('Active', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
'name' => __('Name', 'wp-multisite-waas'),
|
||||
'webhook_url' => __('Target URL', 'wp-multisite-waas'),
|
||||
'event' => __('Trigger Event', 'wp-multisite-waas'),
|
||||
'event_count' => __('Count', 'wp-multisite-waas'),
|
||||
'integration' => __('Integration', 'wp-multisite-waas'),
|
||||
'active' => __('Active', 'wp-multisite-waas'),
|
||||
'id' => __('ID', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -30,10 +30,10 @@ class Invoice_List_Table extends Parent_Payment_List_Table {
|
||||
public function get_columns() {
|
||||
|
||||
$columns = [
|
||||
'hash' => __('Code', 'wp-ultimo'),
|
||||
'status' => __('Status', 'wp-ultimo'),
|
||||
'total' => __('Total', 'wp-ultimo'),
|
||||
'date_created' => __('Created at', 'wp-ultimo'),
|
||||
'hash' => __('Code', 'wp-multisite-waas'),
|
||||
'status' => __('Status', 'wp-multisite-waas'),
|
||||
'total' => __('Total', 'wp-multisite-waas'),
|
||||
'date_created' => __('Created at', 'wp-multisite-waas'),
|
||||
];
|
||||
|
||||
return $columns;
|
||||
|
@ -73,7 +73,7 @@ class Site_List_Table extends Parent_Site_List_Table {
|
||||
'all' => [
|
||||
'field' => 'type',
|
||||
'url' => add_query_arg('type', 'all'),
|
||||
'label' => __('Your Sites', 'wp-ultimo'),
|
||||
'label' => __('Your Sites', 'wp-multisite-waas'),
|
||||
'count' => 0,
|
||||
],
|
||||
];
|
||||
|
Reference in New Issue
Block a user