Files
// Register Custom Post Type
function files_post_type() {
$labels = array(
'name' => _x( 'Файлы', 'Post Type General Name', 'dstheme' ),
'singular_name' => _x( 'Файл', 'Post Type Singular Name', 'dstheme' ),
'menu_name' => __( 'Файлы', 'dstheme' ),
'name_admin_bar' => __( 'Файлы', 'dstheme' ),
'archives' => __( 'Файлы', 'dstheme' ),
'attributes' => __( 'Item Attributes', 'dstheme' ),
'parent_item_colon' => __( 'Parent Item:', 'dstheme' ),
'all_items' => __( 'Все файлы', 'dstheme' ),
'add_new_item' => __( 'Добавить файл', 'dstheme' ),
'add_new' => __( 'Добавить новый', 'dstheme' ),
'new_item' => __( 'Новый', 'dstheme' ),
'edit_item' => __( 'Редактировать', 'dstheme' ),
'update_item' => __( 'Обновить', 'dstheme' ),
'view_item' => __( 'Просмотр файла', 'dstheme' ),
'view_items' => __( 'Просмотр файлов', 'dstheme' ),
'search_items' => __( 'Поиск файла', 'dstheme' ),
'not_found' => __( 'Не найдено', 'dstheme' ),
'not_found_in_trash' => __( 'В корзине не найдено', 'dstheme' ),
'featured_image' => __( 'Featured Image', 'dstheme' ),
'set_featured_image' => __( 'Set featured image', 'dstheme' ),
'remove_featured_image' => __( 'Remove featured image', 'dstheme' ),
'use_featured_image' => __( 'Use as featured image', 'dstheme' ),
'insert_into_item' => __( 'Insert into item', 'dstheme' ),
'uploaded_to_this_item' => __( 'Uploaded to this item', 'dstheme' ),
'items_list' => __( 'Items list', 'dstheme' ),
'items_list_navigation' => __( 'Items list navigation', 'dstheme' ),
'filter_items_list' => __( 'Filter items list', 'dstheme' ),
);
$args = array(
'label' => __( 'Файл', 'dstheme' ),
'labels' => $labels,
'supports' => array( 'title', 'editor' ),
'taxonomies' => array( 'files_category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 25,
'menu_icon' => 'dashicons-category',
'show_in_admin_bar' => false,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'page',
);
register_post_type( 'files', $args );
}
add_action( 'init', 'files_post_type', 0 );