Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15726 closed enhancement (fixed)

Allow for "bad slugs" to be blocked in wp_unique_post_slug

Reported by: westi's profile westi Owned by: westi's profile westi
Milestone: 3.1 Priority: normal
Severity: minor Version: 3.0.2
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Depending on server configuration and rewrite configuration there are any number of slugs which won't work well for root pages.

Examples might be wp-admin, wp-content, wp-includes

Attachments (1)

allow_bad_slug_marking.diff (2.0 KB) - added by westi 13 years ago.
Something like this should allow a plugin to handle these and any other collisions

Download all attachments as: .zip

Change History (4)

#1 @westi
13 years ago

We need to add some hooks to wp_unique_post_slug - one in each of the three branches in these lines similar to this I think:

f ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_slug', false, .... ) {

@westi
13 years ago

Something like this should allow a plugin to handle these and any other collisions

#2 @ryan
13 years ago

Works for me.

#3 @westi
13 years ago

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

(In [16960]) Allow a plugin to filter our slugs if it wants to. Fixes #15726

Note: See TracTickets for help on using tickets.