Make WordPress Core

Opened 5 years ago

Last modified 9 months ago

#29669 new enhancement

Static base in permalink_structure unexpectedly sets $wp_rewrite->front value

Reported by: danielbachhuber Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: needs-patch
Focuses: Cc:


When I use a permalink structure like /story/%post_id%/%postname%/, the author and date URLs inherit the same /story/ base (e.g. /story/author/danielbachhuber/). I'd expect my author and date URLs to remain unchanged, unless I explicitly specify a base.

There appears to be some crude %post_id% conflict resolution for date which forces this. It's not clear why the front value is applied to author_structure.

This code is 9 years young (#2433), so probably too late to make a breaking change. It would be nice to have a filter around $wp_rewrite->front in $wp_rewrite->init() so I don't have filter both rewrite rules and links.

Change History (3)

This ticket was mentioned in Slack in #core by jorbin. View the logs.

5 years ago

#2 @jorbin
5 years ago

  • Type changed from defect (bug) to enhancement

I think a filter here makes sense. I'm hesitant to make a change to every sites permalinks. At this point, it may as well be a feature so I'm going to reclassify this as an enhacement.

A patch that adds the filter and a simple plugin to demonstrate the usefulness of a filter would help move this forward.

#3 @danielbachhuber
5 years ago

I'll see what I can do about that.

Note: See TracTickets for help on using tickets.