WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 10 months ago

#15324 assigned enhancement

There needs to be a page_base in rewrite.php

Reported by: nkuttler Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.1
Component: Rewrite Rules Keywords: dev-feedback needs-refresh
Focuses: 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 5 years ago.
First patch

Download all attachments as: .zip

Change History (10)

@nkuttler5 years ago

First patch

comment:1 follow-up: @scribu5 years ago

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

comment:2 follow-up: @scribu5 years ago

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

comment:3 in reply to: ↑ 1 @nkuttler5 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 @nkuttler5 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.

comment:5 @nkuttler5 years ago

  • Owner nkuttler deleted
  • Status changed from new to assigned

comment:6 @markjaquith5 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:7 @nacin5 years ago

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.

comment:8 @scribu5 years ago

Related: #15082

comment:9 @chriscct710 months ago

  • Keywords needs-refresh added; has-patch removed

Patch needs a refresh but someone from core should re-review this ticket before that happens.

Note: See TracTickets for help on using tickets.