Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#11449 closed feature request (fixed)

register_taxonomy should have flexibility when using with_front option in permalink structure

Reported by: prettyboymp Owned by: filosofo
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: Taxonomy Keywords: has-patch tested dev-feedback
Focuses: Cc:


By default, the register_taxonomy function adds the permastruct without passing in a 'with_front' parameter. This defaults it as true which adds the posts permastructure front at the beginning of the taxonomy permastructure even if the taxonomy isn't related to posts. The register_taxonomy should accept args to turn this off.

Attachments (2)

11449.patch (826 bytes) - added by prettyboymp 6 years ago.
11449-2.patch (828 bytes) - added by prettyboymp 6 years ago.
updated patch

Download all attachments as: .zip

Change History (9)

@prettyboymp6 years ago

comment:1 @hakre6 years ago

Nice find.

comment:2 @hakre6 years ago

  • Keywords tested added

comment:3 @hakre6 years ago

  • Keywords dev-feedback added

Some devs should consider to commit this patch or to just drop it and close the ticket.

comment:4 @ryan6 years ago

Example links before and after the patch? Example post permastruct?

comment:5 @ryan6 years ago

Looks good to me, I just want to document the expectations so we can get some test cases going.

comment:6 @prettyboymp6 years ago

Example post permastruct: /blog/%year%/%monthnum%/%postname%/

Example link before patch for a taxonomy with the following rewrite array('slug' => 'people', 'with_front' => false) : /blog/people/%term-slug%/

Example link after patch for a taxonomy with the following rewrite array('slug' => 'people', 'with_front' => false) : /people/%term-slug%/

@prettyboymp6 years ago

updated patch

comment:7 @ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12791]) Add flag to taxonomy registration allowing permalinks to be prepended with front, or not. Props prettyboymp. fixes #11449

Note: See TracTickets for help on using tickets.