feat(wpmc S2): register ACF group list_shortcode for shortcode-town
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,53 @@ final class FieldGroup
|
||||
|
||||
public static function do_register(): void
|
||||
{
|
||||
// Implementation filled in Tasks 13 and 14.
|
||||
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' => __('Подстановки по городам', 'wp-multi-city'),
|
||||
'name' => 'list_shortcode',
|
||||
'type' => 'repeater',
|
||||
'layout' => 'table',
|
||||
'button_label' => __('Добавить город', 'wp-multi-city'),
|
||||
'sub_fields' => [
|
||||
[
|
||||
'key' => 'field_wpmc_list_shortcode_town',
|
||||
'label' => __('Город', 'wp-multi-city'),
|
||||
'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' => __('Значение', 'wp-multi-city'),
|
||||
'name' => 'text',
|
||||
'type' => 'textarea',
|
||||
'rows' => 4,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'location' => [
|
||||
[
|
||||
['param' => 'post_type', 'operator' => '==', 'value' => 'shortcode-town'],
|
||||
],
|
||||
],
|
||||
'menu_order' => 0,
|
||||
'position' => 'normal',
|
||||
'style' => 'default',
|
||||
'active' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user