add number arcticle
This commit is contained in:
@@ -514,6 +514,105 @@ function find_perevod($post_id){
|
||||
|
||||
}
|
||||
|
||||
# add concurs
|
||||
/**
|
||||
add_action( 'init', function () {
|
||||
|
||||
|
||||
// Указываем метки UI для произвольного типа записи
|
||||
|
||||
$labels = array(
|
||||
|
||||
'name' => _x( 'Movies', 'Post Type General Name', 'twentythirteen' ),
|
||||
|
||||
'singular_name' => _x( 'Movie', 'Post Type Singular Name', 'twentythirteen' ),
|
||||
|
||||
'menu_name' => __( 'Movies', 'twentythirteen' ),
|
||||
|
||||
'parent_item_colon' => __( 'Parent Movie', 'twentythirteen' ),
|
||||
|
||||
'all_items' => __( 'All Movies', 'twentythirteen' ),
|
||||
|
||||
'view_item' => __( 'View Movie', 'twentythirteen' ),
|
||||
|
||||
'add_new_item' => __( 'Add New Movie', 'twentythirteen' ),
|
||||
|
||||
'add_new' => __( 'Add New', 'twentythirteen' ),
|
||||
|
||||
'edit_item' => __( 'Edit Movie', 'twentythirteen' ),
|
||||
|
||||
'update_item' => __( 'Update Movie', 'twentythirteen' ),
|
||||
|
||||
'search_items' => __( 'Search Movie', 'twentythirteen' ),
|
||||
|
||||
'not_found' => __( 'Not Found', 'twentythirteen' ),
|
||||
|
||||
'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Задаем опции для произвольного типа записи
|
||||
|
||||
|
||||
|
||||
$args = array(
|
||||
|
||||
'label' => __( 'Конкурсы'),
|
||||
|
||||
'description' => __( 'Управление конкурсами' ),
|
||||
|
||||
'labels' => $labels,
|
||||
|
||||
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),
|
||||
|
||||
'hierarchical' => false,
|
||||
|
||||
'public' => true,
|
||||
|
||||
'show_ui' => true,
|
||||
|
||||
'show_in_menu' => true,
|
||||
|
||||
'show_in_nav_menus' => true,
|
||||
|
||||
'show_in_admin_bar' => true,
|
||||
|
||||
'menu_position' => 5,
|
||||
|
||||
'can_export' => true,
|
||||
|
||||
'has_archive' => true,
|
||||
|
||||
'exclude_from_search' => false,
|
||||
|
||||
'publicly_queryable' => true,
|
||||
|
||||
'capability_type' => 'page',
|
||||
|
||||
|
||||
|
||||
// Вот здесь мы добавим таксономии в наш ПТЗ
|
||||
|
||||
'taxonomies' => [],
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Регистрируем произвольный тип записи
|
||||
|
||||
register_post_type( 'concurs', $args );
|
||||
|
||||
|
||||
|
||||
}, 0);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
add_action( 'pre_get_posts', function ($query) {
|
||||
|
||||
if ( ! is_admin() && $query->is_main_query() ) {
|
||||
|
||||
Reference in New Issue
Block a user