Hidden Custom Post Type

I am just wondering is it possible to create a custom post type in wordpress which is hidden from the wordpress admin panel?

Related posts

Leave a Reply

2 comments

  1. If you want it to be visible everywhere (i.e. search), just without the admin menu, then something to the effect of the following should do the trick when added to functions.php in the theme directory:

    register_post_type( 'project',
        array(
            'labels' => array(
            'name' => _x( 'Projects', 'post type general name', 'namespace' ),
            'singular_name' => _x( 'Project', 'post type singular name', 'namespace' ),
            'add_new' => __( 'Add a New Project', 'namespace' ),
            'add_new_item' => __( 'Add a New Project', 'namespace' ),
            'edit_item' => __( 'Edit Project', 'namespace' ),
            'new_item' => __( 'New Project', 'namespace' ),
            'view_item' => __( 'View Project', 'namespace' ),
            'search_items' => __( 'Search Projects', 'namespace' ),
            'not_found' => __( 'Nothing Found', 'namespace' ),
            'not_found_in_trash' => __( 'Nothing found in Trash', 'namespace' ),
            'parent_item_colon' => ''
        ),
        'description' => "Projects",
        'public' => true, // All the relevant settings below inherit from this setting
        'exclude_from_search' => false, // When a search is conducted through search.php, should it be excluded?
        'publicly_queryable' => true, // When a parse_request() search is conducted, should it be included?
        'show_ui' => false, // Should the primary admin menu be displayed?
        'show_in_nav_menus' => false, // Should it show up in Appearance > Menus?
        'show_in_menu' => false, // This inherits from show_ui, and determines *where* it should be displayed in the admin
        'show_in_admin_bar' => false, // Should it show up in the toolbar when a user is logged in?
        'has_archive' => 'projects',
        'rewrite' => array( 'slug' => 'project' ),
    ));
    

    The WordPress Codex about register_post_type contains more comprehensive information: http://codex.wordpress.org/Function_Reference/register_post_type