[wp-trac] [WordPress Trac] #37237: rewrite rules for hierarchical custom posts seem wrong

WordPress Trac noreply at wordpress.org
Wed Jun 29 19:42:22 UTC 2016


#37237: rewrite rules for hierarchical custom posts seem wrong
----------------------------+-----------------------------
 Reporter:  realblueorange  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Rewrite Rules   |    Version:  4.5.3
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 I have a custom post that is non-hierarchical. It generates permalinks as
 expected:

 mydomain.com/abcd/post-name

 The corresponding rewrite rules seem correct as everything works just
 fine.

 Part of the arguments that I am using for register_post_type:

 {{{
 'hierarchical' => false,
 'supports' => array(
     'title',
     'editor',
     'revisions',
     'thumbnail',
     'page-attributes'
 ),
 'rewrite' => array(
     'slug' => '/abcd',
     'with_front' => false,
     'feeds' => false,
     'pages'=> false
 ),
 }}}

 Setting 'hierarchical' to true and regenerating the rewrite rules results
 in permalinks as expected:

 mydomain.com/abcd/post-name
 mydomain.com/abcd/post-name/child-post

 But: the rewrite rules that are generated do not work with this permalink
 structure.

 I would expect that the rewrite rules that WordPress generates match the
 permalink structure that WordPress generates. Or is that too easy?

 If needed I can provide the rewrite rules that are being generated in both
 cases.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37237>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list