[wp-trac] [WordPress Trac] #34136: Allow register_post_type's rewrite to remove CPT slug

WordPress Trac noreply at wordpress.org
Mon May 29 16:23:35 UTC 2017


#34136: Allow register_post_type's rewrite to remove CPT slug
---------------------------+------------------------------
 Reporter:  BenRacicot     |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Rewrite Rules  |     Version:  4.3.1
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by drzraf):

 In our we have restaurants and "tweaked" the rewrite (cf OP) in order to
 have provide
 {{{
 /<city>/<slug>
 }}}
 URL rather than the much more cumbersome
 {{{
 /restaurant/<city>/<slug>
 }}}
 That best represents the main goal of the website which has no value being
 artificially namespaced.

 We also have a couple of other CPT of less significance (and none of them
 is named after a city) so that conflict are not going to be an issue (or
 at least a minor issue in comparison to having clean URL)

 Having an officially-supported way to omit the CPT URL's segment would be
 appreciated.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34136#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list