From 949fb19e9523f9b27bf087be6aad4ee439c0c52c Mon Sep 17 00:00:00 2001 From: Vladimir Bryzgalov Date: Sun, 17 May 2026 17:01:11 +0500 Subject: [PATCH] fix(wpmc 1.0.1): remove __() from labels (no translations, fixes WP 6.7 notice) Replace all __('...', 'wp-multi-city') calls in CPT, taxonomy, ACF field group, and options page label arrays with literal Russian strings. The plugin ships no .mo translation files, so wrapping labels in __() was YAGNI and triggered the WP 6.7+ _load_textdomain_just_in_time notice. Co-Authored-By: Claude Opus 4.7 --- includes/class-field-group.php | 8 ++++---- includes/class-options-page.php | 22 +++++++++++----------- includes/class-post-type.php | 20 ++++++++++---------- includes/class-taxonomy.php | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/includes/class-field-group.php b/includes/class-field-group.php index e6d05f0..e32bd81 100644 --- a/includes/class-field-group.php +++ b/includes/class-field-group.php @@ -25,15 +25,15 @@ final class FieldGroup 'fields' => [ [ 'key' => self::REPEATER_KEY, - 'label' => __('Подстановки по городам', 'wp-multi-city'), + 'label' => 'Подстановки по городам', 'name' => 'list_shortcode', 'type' => 'repeater', 'layout' => 'table', - 'button_label' => __('Добавить город', 'wp-multi-city'), + 'button_label' => 'Добавить город', 'sub_fields' => [ [ 'key' => 'field_wpmc_list_shortcode_town', - 'label' => __('Город', 'wp-multi-city'), + 'label' => 'Город', 'name' => 'town', 'type' => 'taxonomy', 'taxonomy' => 'town', @@ -45,7 +45,7 @@ final class FieldGroup ], [ 'key' => 'field_wpmc_list_shortcode_text', - 'label' => __('Значение', 'wp-multi-city'), + 'label' => 'Значение', 'name' => 'text', 'type' => 'textarea', 'rows' => 4, diff --git a/includes/class-options-page.php b/includes/class-options-page.php index 04c4ca1..0e2ecd5 100644 --- a/includes/class-options-page.php +++ b/includes/class-options-page.php @@ -35,7 +35,7 @@ final class OptionsPage 'fields' => [ [ 'key' => 'field_wpmc_main_town_slug', - 'label' => __('Главный город (без префикса URL)', 'wp-multi-city'), + 'label' => 'Главный город (без префикса URL)', 'name' => 'main_town_slug', 'type' => 'taxonomy', 'taxonomy' => 'town', @@ -47,7 +47,7 @@ final class OptionsPage ], [ 'key' => 'field_wpmc_index_town_alt', - 'label' => __('Главная для других городов', 'wp-multi-city'), + 'label' => 'Главная для других городов', 'name' => 'index_town_alt', 'type' => 'post_object', 'post_type' => ['page'], @@ -57,15 +57,15 @@ final class OptionsPage ], [ 'key' => 'field_wpmc_page_unic', - 'label' => __('Клоны страниц', 'wp-multi-city'), + 'label' => 'Клоны страниц', 'name' => 'page_unic', 'type' => 'repeater', 'layout' => 'table', - 'button_label' => __('Добавить клон', 'wp-multi-city'), + 'button_label' => 'Добавить клон', 'sub_fields' => [ [ 'key' => 'field_wpmc_page_unic_page_old', - 'label' => __('Оригинал', 'wp-multi-city'), + 'label' => 'Оригинал', 'name' => 'page_old', 'type' => 'post_object', 'post_type' => ['page'], @@ -75,7 +75,7 @@ final class OptionsPage ], [ 'key' => 'field_wpmc_page_unic_page_new', - 'label' => __('Клон', 'wp-multi-city'), + 'label' => 'Клон', 'name' => 'page_new', 'type' => 'post_object', 'post_type' => ['page'], @@ -85,7 +85,7 @@ final class OptionsPage ], [ 'key' => 'field_wpmc_page_unic_town', - 'label' => __('Город', 'wp-multi-city'), + 'label' => 'Город', 'name' => 'town', 'type' => 'taxonomy', 'taxonomy' => 'town', @@ -99,18 +99,18 @@ final class OptionsPage ], [ 'key' => 'field_wpmc_page_no_rep', - 'label' => __('Исключения из роутинга', 'wp-multi-city'), + 'label' => 'Исключения из роутинга', 'name' => 'page_no_rep', 'type' => 'repeater', 'layout' => 'table', - 'button_label' => __('Добавить исключение', 'wp-multi-city'), + 'button_label' => 'Добавить исключение', 'sub_fields' => [ [ 'key' => 'field_wpmc_page_no_rep_link', - 'label' => __('Путь', 'wp-multi-city'), + 'label' => 'Путь', 'name' => 'link', 'type' => 'text', - 'instructions' => __('Префикс URL, например /privacy/', 'wp-multi-city'), + 'instructions' => 'Префикс URL, например /privacy/', ], ], ], diff --git a/includes/class-post-type.php b/includes/class-post-type.php index 4203de5..0b335b1 100644 --- a/includes/class-post-type.php +++ b/includes/class-post-type.php @@ -16,16 +16,16 @@ final class PostType { register_post_type(self::SLUG, [ 'labels' => [ - 'name' => __('Шорткоды', 'wp-multi-city'), - 'singular_name' => __('Шорткод', 'wp-multi-city'), - 'menu_name' => __('Шорткоды', 'wp-multi-city'), - 'add_new' => __('Добавить', 'wp-multi-city'), - 'add_new_item' => __('Добавить шорткод', 'wp-multi-city'), - 'edit_item' => __('Редактировать', 'wp-multi-city'), - 'new_item' => __('Новый', 'wp-multi-city'), - 'view_item' => __('Смотреть', 'wp-multi-city'), - 'search_items' => __('Поиск', 'wp-multi-city'), - 'not_found' => __('Не найдено', 'wp-multi-city'), + 'name' => 'Шорткоды', + 'singular_name' => 'Шорткод', + 'menu_name' => 'Шорткоды', + 'add_new' => 'Добавить', + 'add_new_item' => 'Добавить шорткод', + 'edit_item' => 'Редактировать', + 'new_item' => 'Новый', + 'view_item' => 'Смотреть', + 'search_items' => 'Поиск', + 'not_found' => 'Не найдено', ], 'public' => false, 'exclude_from_search' => true, diff --git a/includes/class-taxonomy.php b/includes/class-taxonomy.php index 634c90d..9a1d1a7 100644 --- a/includes/class-taxonomy.php +++ b/includes/class-taxonomy.php @@ -16,10 +16,10 @@ final class Taxonomy { register_taxonomy(self::SLUG, [PostType::SLUG], [ 'labels' => [ - 'name' => __('Города', 'wp-multi-city'), - 'singular_name' => __('Город', 'wp-multi-city'), - 'menu_name' => __('Города', 'wp-multi-city'), - 'add_new_item' => __('Добавить', 'wp-multi-city'), + 'name' => 'Города', + 'singular_name' => 'Город', + 'menu_name' => 'Города', + 'add_new_item' => 'Добавить', ], 'public' => false, 'publicly_queryable' => false,