[wp-trac] [WordPress Trac] #12605: Unable to add Endpoints to custom post_types

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 20 02:08:23 UTC 2010


#12605: Unable to add Endpoints to custom post_types
---------------------------+------------------------------------------------
 Reporter:  dd32           |        Owner:  ryan  
     Type:  defect (bug)   |       Status:  closed
 Priority:  normal         |    Milestone:  3.0   
Component:  Rewrite Rules  |      Version:  3.0   
 Severity:  normal         |   Resolution:  fixed 
 Keywords:  has-patch      |  
---------------------------+------------------------------------------------

Comment(by dd32):

 Example use:

 {{{
 define('EP_WIKI', 131072); // 2^17. 2^13 is used by core.
 register_post_type('wiki', array(
         'label' => __('Wiki'),
         'public' => true,
         'supports' => array('revisions', 'editor', 'title'),
         'permalink_epmask' => EP_WIKI,
         'hierarchical' => true
 ));
 add_rewrite_endpoint('history', EP_WIKI);
 }}}

 The post_type 'wiki' rules will now include a /edit/(.../)? endpoint,
 which does not get applied to any other type of rule that core generates.

 Care would need to be taken that any custom endpoints are in 2^x format,
 and not currently in use by any other plugins loaded..

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12605#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list