Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Отзывы

// Register Custom Post Type
function type_tours() {

	$labels = array(
		'name'                  => 'Туры',
		'singular_name'         => 'Туры',
		'menu_name'             => 'Туры',
		'name_admin_bar'        => 'Туры',
		'archives'              => '',
		'attributes'            => '',
		'parent_item_colon'     => '',
		'all_items'             => 'Все туры',
		'add_new_item'          => 'Добавить тур',
		'add_new'               => 'Добавить тур',
		'new_item'              => 'Новый тур',
		'edit_item'             => 'Редактировать тур',
		'update_item'           => 'Обновить тур',
		'view_item'             => 'Посмотреть тур',
		'view_items'            => 'Посмотреть туры',
		'search_items'          => 'Искать тур',
		'not_found'             => 'Не найдено',
		'not_found_in_trash'    => '',
		'featured_image'        => '',
		'set_featured_image'    => '',
		'remove_featured_image' => '',
		'use_featured_image'    => '',
		'insert_into_item'      => '',
		'uploaded_to_this_item' => '',
		'items_list'            => '',
		'items_list_navigation' => '',
		'filter_items_list'     => '',
	);
	$args = array(
		'label'                 => 'Туры',
		'description'           => 'Post Type Description',
		'labels'                => $labels,
		'supports'              => array( 'title', 'editor', 'thumbnail', 'custom-fields' ),
		'hierarchical'          => false,
		'public'                => true,
		'show_ui'               => true,
		'show_in_menu'          => true,
		'menu_position'         => 5,
		'menu_icon'             => 'dashicons-palmtree',
		'show_in_admin_bar'     => true,
		'show_in_nav_menus'     => true,
		'can_export'            => false,
		'has_archive'           => false,
		'exclude_from_search'   => false,
		'publicly_queryable'    => true,
		'rewrite'               => false,
		'capability_type'       => 'page',
		'show_in_rest'          => false,
	);
	register_post_type( 'tours', $args );

}
add_action( 'init', 'type_tours', 0 );