Projects
// Register Custom Post Type
function post_type_projects() {
$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' => 'Featured Image',
'set_featured_image' => 'Set featured image',
'remove_featured_image' => 'Remove featured image',
'use_featured_image' => 'Use as featured image',
'insert_into_item' => 'Вставить в проект',
'uploaded_to_this_item' => 'Загружено для данного проекта',
'items_list' => 'Список проектов',
'items_list_navigation' => 'Навигация по проектам',
'filter_items_list' => 'Фильтровать проекты',
);
$rewrite = array(
'slug' => 'project',
'with_front' => true,
'pages' => true,
'feeds' => false,
);
$args = array(
'label' => 'Проект',
'description' => 'Реализованные проекты',
'labels' => $labels,
'supports' => array( 'title', 'custom-fields' ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-portfolio',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'post',
'show_in_rest' => false,
);
register_post_type( 'projects', $args );
}
add_action( 'init', 'post_type_projects', 0 );