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:
@ -85,14 +85,14 @@ class My_Sites_Element extends Base_Element {
|
||||
*
|
||||
* This is used on the Blocks list of Gutenberg.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('My Element', 'wp-ultimo').
|
||||
* e.g. return __('My Element', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
|
||||
return __('My Sites', 'wp-ultimo');
|
||||
return __('My Sites', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -101,14 +101,14 @@ class My_Sites_Element extends Base_Element {
|
||||
* This is also used on the Gutenberg block list
|
||||
* to explain what this block is about.
|
||||
* You should return a string with the localized title.
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-ultimo').
|
||||
* e.g. return __('Adds a checkout form to the page', 'wp-multisite-waas').
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_description() {
|
||||
|
||||
return __('Adds a block to display the sites owned by the current customer.', 'wp-ultimo');
|
||||
return __('Adds a block to display the sites owned by the current customer.', 'wp-multisite-waas');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,33 +133,33 @@ class My_Sites_Element extends Base_Element {
|
||||
$fields = [];
|
||||
|
||||
$fields['header'] = [
|
||||
'title' => __('General', 'wp-ultimo'),
|
||||
'desc' => __('General', 'wp-ultimo'),
|
||||
'title' => __('General', 'wp-multisite-waas'),
|
||||
'desc' => __('General', 'wp-multisite-waas'),
|
||||
'type' => 'header',
|
||||
];
|
||||
|
||||
$fields['site_manage_type'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Site Manage Type', 'wp-ultimo'),
|
||||
'desc' => __('The page to manage a site.', 'wp-ultimo'),
|
||||
'title' => __('Site Manage Type', 'wp-multisite-waas'),
|
||||
'desc' => __('The page to manage a site.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'default' => 'default',
|
||||
'options' => [
|
||||
'default' => __('Same Page', 'wp-ultimo'),
|
||||
'wp_admin' => __('WP Admin', 'wp-ultimo'),
|
||||
'custom_page' => __('Custom Page', 'wp-ultimo'),
|
||||
'default' => __('Same Page', 'wp-multisite-waas'),
|
||||
'wp_admin' => __('WP Admin', 'wp-multisite-waas'),
|
||||
'custom_page' => __('Custom Page', 'wp-multisite-waas'),
|
||||
],
|
||||
];
|
||||
|
||||
$fields['site_show'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Which sites to show?', 'wp-ultimo'),
|
||||
'desc' => __('Select which sites should be listed for user.', 'wp-ultimo'),
|
||||
'title' => __('Which sites to show?', 'wp-multisite-waas'),
|
||||
'desc' => __('Select which sites should be listed for user.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'default' => 'all',
|
||||
'options' => [
|
||||
'all' => __('All', 'wp-ultimo'),
|
||||
'owned' => __('Owned', 'wp-ultimo'),
|
||||
'all' => __('All', 'wp-multisite-waas'),
|
||||
'owned' => __('Owned', 'wp-multisite-waas'),
|
||||
],
|
||||
];
|
||||
|
||||
@ -171,7 +171,7 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$pages = $pages ?: [];
|
||||
|
||||
$pages_list = [0 => __('Current Page', 'wp-ultimo')];
|
||||
$pages_list = [0 => __('Current Page', 'wp-multisite-waas')];
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$pages_list[ $page->ID ] = $page->post_title;
|
||||
@ -179,9 +179,9 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$fields['custom_manage_page'] = [
|
||||
'type' => 'select',
|
||||
'title' => __('Manage Redirect Page', 'wp-ultimo'),
|
||||
'title' => __('Manage Redirect Page', 'wp-multisite-waas'),
|
||||
'value' => 0,
|
||||
'desc' => __('The page to redirect user after select a site.', 'wp-ultimo'),
|
||||
'desc' => __('The page to redirect user after select a site.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'required' => [
|
||||
'site_manage_type' => 'custom_page',
|
||||
@ -191,8 +191,8 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$fields['columns'] = [
|
||||
'type' => 'number',
|
||||
'title' => __('Columns', 'wp-ultimo'),
|
||||
'desc' => __('How many columns to use.', 'wp-ultimo'),
|
||||
'title' => __('Columns', 'wp-multisite-waas'),
|
||||
'desc' => __('How many columns to use.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 4,
|
||||
'min' => 1,
|
||||
@ -201,8 +201,8 @@ class My_Sites_Element extends Base_Element {
|
||||
|
||||
$fields['display_images'] = [
|
||||
'type' => 'toggle',
|
||||
'title' => __('Display Site Screenshot?', 'wp-ultimo'),
|
||||
'desc' => __('Toggle to show/hide the site screenshots on the element.', 'wp-ultimo'),
|
||||
'title' => __('Display Site Screenshot?', 'wp-multisite-waas'),
|
||||
'desc' => __('Toggle to show/hide the site screenshots on the element.', 'wp-multisite-waas'),
|
||||
'tooltip' => '',
|
||||
'value' => 1,
|
||||
];
|
||||
|
Reference in New Issue
Block a user