[wp-trac] [WordPress Trac] #24812: register_post_type should allow you to include posts in the main blog
WordPress Trac
noreply at wordpress.org
Sun Jul 21 19:39:44 UTC 2013
#24812: register_post_type should allow you to include posts in the main blog
---------------------------+-----------------------------
Reporter: unknowndomain | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Post Types | Version:
Severity: normal | Keywords:
---------------------------+-----------------------------
When you create a Custom Post Type, there should be an argument like
`public` etc... that allows your post type to be included in the main
blog, just like `post` does.
This could be something like this:
{{{ 'include_on_home_query' => true, }}}
Example:
{{{
register_post_type( 'activity', array(
'labels' => array(
'name' => __( 'Activities' ),
'singular_name' => __( 'Activity' ),
'all_items' => __( 'All Activities' ),
'add_new_item' => __( 'Add New Activity' ),
'edit_item' => __( 'Edit Activity' ),
'new_item' => __( 'New Activity' ),
'view_item' => __( 'View Activity' ),
'search_items' => __( 'Search Activities' ),
'not_found' => __( 'No Activities found' ),
'not_found_in_trash' => __( 'No Activities found in Trash'
)
),
'public' => true,
'include_on_home_query' => true,
'menu_position' => 5,
'menu_icon' => plugin_dir_url(__FILE__) . 'icon.png',
'supports' => array(
'title',
'editor',
'thumbnail'
),
'register_meta_box_cb' => array( &$this, 'register_metabox' ),
'taxonomies' => array(
'year'
),
'has_archive' => true
) );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24812>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list