Не удается получить доступ к тегам пользовательского типа записи? - PullRequest
0 голосов
/ 25 февраля 2019

Я создал пользовательский тип записи с именем "blogs".

$labels = array(
        'name'               => _x( 'Blogs', 'post type general name', 'your-plugin-textdomain' ),
        'singular_name'      => _x( 'blog', 'post type singular name', 'your-plugin-textdomain' ),
        'menu_name'          => _x( 'Blogs', 'admin menu', 'your-plugin-textdomain' ),
        'name_admin_bar'     => _x( 'Blog', 'add new on admin bar', 'your-plugin-textdomain' ),
        'add_new'            => _x( 'Add New', 'blog', 'your-plugin-textdomain' ),
        'add_new_item'       => __( 'Add New Blog', 'your-plugin-textdomain' ),
        'new_item'           => __( 'New Blog', 'your-plugin-textdomain' ),
        'edit_item'          => __( 'Edit Blog', 'your-plugin-textdomain' ),
        'view_item'          => __( 'View Blog', 'your-plugin-textdomain' ),
        'all_items'          => __( 'All Blogs', 'your-plugin-textdomain' ),
        'search_items'       => __( 'Search Blogs', 'your-plugin-textdomain' ),
        'parent_item_colon'  => __( 'Parent Blogs:', 'your-plugin-textdomain' ),
        'not_found'          => __( 'No blogs found.', 'your-plugin-textdomain' ),
        'not_found_in_trash' => __( 'No blogs found in Trash.', 'your-plugin-textdomain' )
    );

    $args = array(
        'labels'             => $labels,
        'description'        => __( 'Description.', 'your-plugin-textdomain' ),
        'public'             => true,
        'publicly_queryable' => true,
        'show_ui'            => true,
        'show_in_menu'       => true,
        'query_var'          => true,
        'rewrite'            => array( 'slug' => 'blogs','with_front' => false),
        'capability_type'    => 'post',
        'taxonomies' => array('blog', 'post_tag') , 
        'has_archive'        => true,
        'hierarchical'       => true,
        'menu_position'      => 'dashicons-portfolio',
        'supports'           => array( 'title', 'post-formats', 'editor', 'excerpt', 'thumbnail', 'comments', 'custom-fields', 'revisions','author'),
    );

    register_post_type( 'blogs', $args );

, а затем я зарегистрировал таксономию

register_taxonomy(
        'blog',
        'blogs',
        array(
            'label' => __( 'Blogs Category' ),
            'rewrite' => array( 'slug' => 'blog' ),         
            'hierarchical' => true,
            'show_admin_column' => true,
            'show_ui' => true,
            'show_tagcloud' => true,

        )
    );

Она отображается так же, как в панели администратора:

enter image description here

Когда я нажимаю на ссылку Теги, появляется сообщение «Доступ запрещен»

enter image description here

`edit-tags.php?taxonomy=post_tag&post_type=blogs` is not accessable.

Где я ошибаюсь?

...