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:
@ -82,7 +82,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('Template Switching', 'wp-ultimo');
|
||||
return __('Template Switching', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -93,7 +93,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds the template switching form to this page.', 'wp-ultimo');
|
||||
return __('Adds the template switching form to this page.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,8 +142,8 @@ class Template_Switching_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('Layout', 'wp-ultimo'),
|
||||
'desc' => __('Layout', 'wp-ultimo'),
|
||||
'title' => __('Layout', 'wp-multisite-waas'),
|
||||
'desc' => __('Layout', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
@ -153,8 +153,8 @@ class Template_Switching_Element extends Base_Element {
|
||||
'fields' => [
|
||||
'template_selection_template' => [
|
||||
'type' => 'select',
|
||||
'title' => __('Template Selector Layout', 'wp-ultimo'),
|
||||
'placeholder' => __('Select your Layout', 'wp-ultimo'),
|
||||
'title' => __('Template Selector Layout', 'wp-multisite-waas'),
|
||||
'placeholder' => __('Select your Layout', 'wp-multisite-waas'),
|
||||
'default' => 'clean',
|
||||
'options' => [$this, 'get_template_selection_templates'],
|
||||
'wrapper_classes' => 'wu-flex-grow',
|
||||
@ -170,7 +170,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
'order' => 99,
|
||||
'wrapper_classes' => 'sm:wu-p-0 sm:wu-block',
|
||||
'classes' => '',
|
||||
'desc' => sprintf('<div class="wu-p-4 wu-bg-blue-100 wu-text-grey-600">%s</div>', __('Want to add customized template selection templates?<br><a target="_blank" class="wu-no-underline" href="https://help.wpultimo.com/article/343-customize-your-checkout-flow-using-field-templates">See how you can do that here</a>.', 'wp-ultimo')),
|
||||
'desc' => sprintf('<div class="wu-p-4 wu-bg-blue-100 wu-text-grey-600">%s</div>', __('Want to add customized template selection templates?<br><a target="_blank" class="wu-no-underline" href="https://help.wpultimo.com/article/343-customize-your-checkout-flow-using-field-templates">See how you can do that here</a>.', 'wp-multisite-waas')),
|
||||
];
|
||||
|
||||
return $fields;
|
||||
@ -275,7 +275,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
$template_id = wu_request('template_id', '');
|
||||
|
||||
if ( ! $template_id) {
|
||||
return new \WP_Error('template_id_required', __('You need to provide a valid template to duplicate.', 'wp-ultimo'));
|
||||
return new \WP_Error('template_id_required', __('You need to provide a valid template to duplicate.', 'wp-multisite-waas'));
|
||||
}
|
||||
|
||||
$switch = \WP_Ultimo\Helpers\Site_Duplicator::override_site($template_id, $this->site->get_id());
|
||||
@ -349,12 +349,12 @@ class Template_Switching_Element extends Base_Element {
|
||||
|
||||
$template_class = Field_Templates_Manager::get_instance()->get_template_class('template_selection', $atts['template_selection_template']);
|
||||
|
||||
$content = $template_class ? $template_class->render_container($template_attributes, $reducer_class) : __('Template does not exist.', 'wp-ultimo');
|
||||
$content = $template_class ? $template_class->render_container($template_attributes, $reducer_class) : __('Template does not exist.', 'wp-multisite-waas');
|
||||
|
||||
$checkout_fields['back_to_template_selection'] = [
|
||||
'type' => 'note',
|
||||
'order' => 0,
|
||||
'desc' => sprintf('<a href="#" class="wu-no-underline wu-mt-1 wu-uppercase wu-text-2xs wu-font-semibold wu-text-gray-600" v-on:click.prevent="template_id = original_template_id; confirm_switch = false">%s</a>', __('← Back to Template Selection', 'wp-ultimo')),
|
||||
'desc' => sprintf('<a href="#" class="wu-no-underline wu-mt-1 wu-uppercase wu-text-2xs wu-font-semibold wu-text-gray-600" v-on:click.prevent="template_id = original_template_id; confirm_switch = false">%s</a>', __('← Back to Template Selection', 'wp-multisite-waas')),
|
||||
'wrapper_html_attr' => [
|
||||
'v-init:original_template_id' => $this->site->get_template_id(),
|
||||
'v-show' => 'template_id != original_template_id',
|
||||
@ -375,8 +375,8 @@ class Template_Switching_Element extends Base_Element {
|
||||
|
||||
$checkout_fields['confirm_switch'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Confirm template switch?', 'wp-ultimo'),
|
||||
'desc' => __('Switching your current template completely overwrites the content of your site with the contents of the newly chosen template. All customizations will be lost. This action cannot be undone.', 'wp-ultimo'),
|
||||
'title' => __('Confirm template switch?', 'wp-multisite-waas'),
|
||||
'desc' => __('Switching your current template completely overwrites the content of your site with the contents of the newly chosen template. All customizations will be lost. This action cannot be undone.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'wrapper_classes' => '',
|
||||
'value' => 0,
|
||||
@ -391,7 +391,7 @@ class Template_Switching_Element extends Base_Element {
|
||||
|
||||
$checkout_fields['submit_switch'] = [
|
||||
'type' => 'link',
|
||||
'display_value' => __('Process Switch', 'wp-ultimo'),
|
||||
'display_value' => __('Process Switch', 'wp-multisite-waas'),
|
||||
'wrapper_classes' => 'wu-text-right wu-bg-gray-100',
|
||||
'classes' => 'button button-primary',
|
||||
'wrapper_html_attr' => [
|
||||
|
Reference in New Issue
Block a user