admin管理员组

文章数量:1289878

I have this code in my functions.php, don't know what to do next??

function our_artist(){
    $labels = array(
        'name' => 'Artists',
        'singular_name' => 'Artist',
        'add_new' => 'Add Item',
        'all_item' => 'All Item',
        'add_new_item' => 'Add Item',
        'edit_item' => 'Edit Item',
        'new_iten' => 'New Item',
        'view_item' => 'View Item',
        'search_item' => 'Search',
        'not_found' => 'No Items found',
        'not_found_in_trash' => 'No Items found in trash',
        'parent_item_colon' => 'Parent Item'
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'has_archive' => true,
        'publicly_queryable' => true,
        'query_var' => true,
        'rewrite' => true,
        'capability_type' => 'post',
        'hierarchical' => false,
        'supports' => array(
            'title',
            'editor',
            'revisions',
            'thumbnail',
            'excerpt'
        ),
        'menu_position' => 5,
        'exclude_from_search' => false
    );
    register_post_type('artists',$args);

    
    flush_rewrite_rules();
}
add_action('init', 'our_artist');

function arc_create_artist_cat_tax_rewrite() {
    register_taxonomy('artist_cat',array('artists'), array(
        'hierarchical' => true,
        'labels' => 'Artist Category',
        'show_ui' => true,
        'show_in_rest' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'artist_cat' ),
    ));
}
add_action( 'init', 'arc_create_artist_cat_tax_rewrite', 0 );

本文标签: phpopen custom post type in popup window instead of page