949fb19e95
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 <noreply@anthropic.com>
68 lines
2.3 KiB
PHP
68 lines
2.3 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace WPMultiCity;
|
|
|
|
final class FieldGroup
|
|
{
|
|
public const GROUP_KEY = 'group_wpmc_shortcode_rows';
|
|
public const REPEATER_KEY = 'field_wpmc_list_shortcode';
|
|
|
|
public static function register(): void
|
|
{
|
|
add_action('acf/init', [self::class, 'do_register']);
|
|
}
|
|
|
|
public static function do_register(): void
|
|
{
|
|
if (!function_exists('acf_add_local_field_group')) {
|
|
return;
|
|
}
|
|
|
|
acf_add_local_field_group([
|
|
'key' => self::GROUP_KEY,
|
|
'title' => 'WPMultiCity / Shortcode rows',
|
|
'fields' => [
|
|
[
|
|
'key' => self::REPEATER_KEY,
|
|
'label' => 'Подстановки по городам',
|
|
'name' => 'list_shortcode',
|
|
'type' => 'repeater',
|
|
'layout' => 'table',
|
|
'button_label' => 'Добавить город',
|
|
'sub_fields' => [
|
|
[
|
|
'key' => 'field_wpmc_list_shortcode_town',
|
|
'label' => 'Город',
|
|
'name' => 'town',
|
|
'type' => 'taxonomy',
|
|
'taxonomy' => 'town',
|
|
'field_type' => 'select',
|
|
'return_format' => 'id',
|
|
'allow_null' => 0,
|
|
'multiple' => 0,
|
|
'add_term' => 0,
|
|
],
|
|
[
|
|
'key' => 'field_wpmc_list_shortcode_text',
|
|
'label' => 'Значение',
|
|
'name' => 'text',
|
|
'type' => 'textarea',
|
|
'rows' => 4,
|
|
],
|
|
],
|
|
],
|
|
],
|
|
'location' => [
|
|
[
|
|
['param' => 'post_type', 'operator' => '==', 'value' => PostType::SLUG],
|
|
],
|
|
],
|
|
'menu_order' => 0,
|
|
'position' => 'normal',
|
|
'style' => 'default',
|
|
'active' => true,
|
|
]);
|
|
}
|
|
}
|