Files
wp-multi-city/includes/class-post-type.php
T
Vladimir Bryzgalov f95d09cc89 feat(wpmc S2): register CPT shortcode-town with required args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:36 +05:00

47 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace WPMultiCity;
final class PostType
{
public const SLUG = 'shortcode-town';
public static function register(): void
{
add_action('init', [self::class, 'do_register']);
}
public static function do_register(): void
{
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'),
],
'public' => false,
'exclude_from_search' => true,
'publicly_queryable' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => false,
'show_in_rest' => false,
'query_var' => false,
'has_archive' => false,
'rewrite' => false,
'hierarchical' => false,
'capability_type' => 'post',
'supports' => ['title'],
'menu_position' => 8,
]);
}
}