[wp-trac] [WordPress Trac] #16075: Add Post Type Archives support in Nav Menus
WordPress Trac
noreply at wordpress.org
Sun Sep 6 01:12:00 UTC 2015
#16075: Add Post Type Archives support in Nav Menus
-------------------------------------------------+-------------------------
Reporter: matzipan | Owner:
Type: enhancement | aaroncampbell
Priority: normal | Status: assigned
Component: Menus | Milestone: 4.4
Severity: normal | Version: 3.1
Keywords: has-patch ui-feedback needs-testing | Resolution:
| Focuses:
-------------------------------------------------+-------------------------
Comment (by seanchayes):
Sure - thanks for clarifying about the customizer
The register CPT code below is what I used and now you focus on it I see
that it took the CPT "singular_name" entry for the Customizer and in my
labels array it had a lower case el. That explains that.
{{{#!php
register_post_type( 'listing' ,
array(
'labels' => array(
'name' => __( 'Listings',
'domain' ),
'singular_name' => __( 'listing',
'domain' ),
'all_items' => __( 'Listings',
'domain' ),
'add_new' => __( 'Add New',
'domain' ),
'add_new_item' => __( 'Add New
Listing', 'domain' ),
'edit' => __( 'Edit',
'domain' ),
'edit_item' => __( 'Edit
Listing', 'domain' ),
'new_item' => __( 'New
Listing', 'domain' ),
'view' => __( 'View
Listing', 'domain' ),
'view_item' => __( 'View
Listing', 'domain' ),
'search_items' => __( 'Search
Listings', 'domain' ),
'not_found' => __( 'No
Listings found', 'domain' ),
'not_found_in_trash' => __( 'No
Listings found in Trash', 'domain' ),
'parent' => __( 'Parent
Listing', 'domain' ),
'capability_type' => 'post',
),
'public' => true,
'show_ui' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'description' => __( 'The description',
'domain' ),
'menu_position' => 5,
'supports' => array( 'title',
'thumbnail', 'author' ),
'rewrite' => array( 'with_front' =>
false ),
'has_archive' => 'listings',
'query_var' => 'listing',
'taxonomies' => array( 'property_type',
'property_location' )
)
);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/16075#comment:100>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list