Custom Post Type not appearing in admin menu
-
I’ve created a custom post type with the plugin and I’ve also checked the new post type is selected going into Appearance -> Manus -> Screen Options. Still not showing up… I’m pasting below the output of the ‘Get the code’ link:
function cptui_register_my_cpts_screenplay() { /** * Post Type: Screenplays. */ $labels = [ "name" => __( "Screenplays", "boston" ), "singular_name" => __( "Screenplay", "boston" ), "menu_name" => __( "My Screenplays", "boston" ), "all_items" => __( "All Screenplays", "boston" ), "add_new" => __( "Add new", "boston" ), "add_new_item" => __( "Add new Screenplay", "boston" ), "edit_item" => __( "Edit Screenplay", "boston" ), "new_item" => __( "New Screenplay", "boston" ), "view_item" => __( "View Screenplay", "boston" ), "view_items" => __( "View Screenplays", "boston" ), "search_items" => __( "Search Screenplays", "boston" ), "not_found" => __( "No Screenplays found", "boston" ), "not_found_in_trash" => __( "No Screenplays found in trash", "boston" ), "parent" => __( "Parent Screenplay:", "boston" ), "featured_image" => __( "Featured image for this Screenplay", "boston" ), "set_featured_image" => __( "Set featured image for this Screenplay", "boston" ), "remove_featured_image" => __( "Remove featured image for this Screenplay", "boston" ), "use_featured_image" => __( "Use as featured image for this Screenplay", "boston" ), "archives" => __( "Screenplay archives", "boston" ), "insert_into_item" => __( "Insert into Screenplay", "boston" ), "uploaded_to_this_item" => __( "Upload to this Screenplay", "boston" ), "filter_items_list" => __( "Filter Screenplays list", "boston" ), "items_list_navigation" => __( "Screenplays list navigation", "boston" ), "items_list" => __( "Screenplays list", "boston" ), "attributes" => __( "Screenplays attributes", "boston" ), "name_admin_bar" => __( "Screenplay", "boston" ), "item_published" => __( "Screenplay published", "boston" ), "item_published_privately" => __( "Screenplay published privately.", "boston" ), "item_reverted_to_draft" => __( "Screenplay reverted to draft.", "boston" ), "item_scheduled" => __( "Screenplay scheduled", "boston" ), "item_updated" => __( "Screenplay updated.", "boston" ), "parent_item_colon" => __( "Parent Screenplay:", "boston" ), ]; $args = [ "label" => __( "Screenplays", "boston" ), "labels" => $labels, "description" => "", "public" => true, "publicly_queryable" => true, "show_ui" => true, "show_in_rest" => true, "rest_base" => "", "rest_controller_class" => "WP_REST_Posts_Controller", "has_archive" => false, "show_in_menu" => true, "show_in_nav_menus" => true, "delete_with_user" => false, "exclude_from_search" => false, "capability_type" => "screenplay", "map_meta_cap" => true, "hierarchical" => false, "rewrite" => [ "slug" => "screenplay", "with_front" => true ], "query_var" => true, "menu_position" => 5, "menu_icon" => "dashicons-media-video", "supports" => [ "title", "editor", "thumbnail", "custom-fields", "author" ], ]; register_post_type( "screenplay", $args ); } add_action( 'init', 'cptui_register_my_cpts_screenplay' );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Post Type not appearing in admin menu’ is closed to new replies.