WordPress.org

Make WordPress Core

Changeset 16960


Ignore:
Timestamp:
12/15/2010 05:56:25 PM (7 years ago)
Author:
westi
Message:

Allow a plugin to filter our slugs if it wants to. Fixes #15726

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r16900 r16960  
    27732773        $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) );
    27742774
    2775         if ( $post_name_check || in_array( $slug, $feeds ) ) {
     2775        if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) {
    27762776            $suffix = 2;
    27772777            do {
     
    27882788        $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID, $post_parent ) );
    27892789
    2790         if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) ) {
     2790        if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug )  || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) {
    27912791            $suffix = 2;
    27922792            do {
     
    28022802        $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) );
    28032803
    2804         if ( $post_name_check || in_array( $slug, $feeds ) ) {
     2804        if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ) ) {
    28052805            $suffix = 2;
    28062806            do {
Note: See TracChangeset for help on using the changeset viewer.