Opened 3 years ago

Last modified 2 years ago

#15324 assigned enhancement

There needs to be a page_base in rewrite.php

Reported by: nkuttler Owned by:
Priority: normal Milestone: Future Release
Component: Rewrite Rules Version: 3.1
Severity: normal Keywords: has-patch, dev-feedback
Cc:

Description

I'm not sure why this feature doesn't exist. It looks trivial and important. There are many reasons for putting pages at, say, /page/%pagename%. The attached patch makes it possible to write a plugin to allow this.

Attachments (1)

page_base.diff (778 bytes) - added by nkuttler 3 years ago.
First patch

Download all attachments as: .zip

Change History (9)

First patch

comment:1 follow-up: ↓ 3   scribu3 years ago

Erm, what about pagination, i.e. /page/2 ?

comment:2 follow-up: ↓ 4   scribu3 years ago

Ideally, this should be transparent in regards to other hierarchical post types.

comment:3 in reply to: ↑ 1   nkuttler3 years ago

Replying to scribu:

Erm, what about pagination, i.e. /page/2 ?

I think that's more of a documentation problem. The page base could conflict with the pagination base, but that's something the plugin/theme developer should probably take care of.

comment:4 in reply to: ↑ 2   nkuttler3 years ago

Replying to scribu:

Ideally, this should be transparent in regards to other hierarchical post types.

With this patch pages can get permalinks more like custom post types. The CPTs still have the with_front parameter, and adding the front to the page permalink is not possible with this patch. I'm not sure if this should be made possible though.

  • Owner nkuttler deleted
  • Status changed from new to assigned
  • Milestone changed from Awaiting Review to Future Release

I'm not a fan of this. You'll probably want to actually leverage a CPT rather than pages in this case, as that's the only real difference. Especially since this patch doesn't take into account rewrite rule generation, as the catchall, or without regard to verbose rules either.

This should probably be done through register_post_type instead. Ideally we can begin to move pages and posts more in the direction of CPTs in terms of dogfood, very similar to what we did in 3.1 with categories and tags.

Related: #15082

Note: See TracTickets for help on using tickets.