Files
wp-multi-city/includes/class-taxonomy.php
T
Vladimir Bryzgalov b06ea9e605 feat(wpmc S2): register taxonomy town with required args
Also stub translation functions in base TestCase so __() calls from
WPMultiCity namespace resolve correctly via Brain Monkey.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:37:29 +05:00

38 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace WPMultiCity;
final class Taxonomy
{
public const SLUG = 'town';
public static function register(): void
{
add_action('init', [self::class, 'do_register']);
}
public static function do_register(): void
{
register_taxonomy(self::SLUG, ['shortcode-town'], [
'labels' => [
'name' => __('Города', 'wp-multi-city'),
'singular_name' => __('Город', 'wp-multi-city'),
'menu_name' => __('Города', 'wp-multi-city'),
'add_new_item' => __('Добавить', 'wp-multi-city'),
],
'public' => false,
'publicly_queryable' => false,
'hierarchical' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => false,
'show_admin_column' => false,
'show_in_rest' => true,
'query_var' => false,
'rewrite' => false,
'meta_box_cb' => false,
]);
}
}