[wp-trac] [WordPress Trac] #12779: Better support for custom post types in WP_Rewrite
WordPress Trac
wp-trac at lists.automattic.com
Sun Mar 13 02:59:11 UTC 2011
#12779: Better support for custom post types in WP_Rewrite
---------------------------+-----------------------------
Reporter: nacin | Owner: ryan
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Rewrite Rules | Version:
Severity: normal | Resolution:
Keywords: |
---------------------------+-----------------------------
Changes (by scribu):
* type: feature request => enhancement
Comment:
How about bundling all the endpoints in the 'rewrite' arg?
Example:
{{{
register_post_type( 'foo', array(
...
'rewrite' => array(
'slug' => 'fooz',
'extra_endpoints' => array( 'bar', 'baz' )
)
);
}}}
Sidenote:
Instead of using EP_MASK, I found it much easier to just use
add_rewrite_rule(), with the CPT slug prefixed to it. Now, if only
add_rewrite_rule() had a $with_front arg...
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12779#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list