Make WordPress Core


Ignore:
Timestamp:
10/31/2015 08:53:41 PM (9 years ago)
Author:
wonderboymusic
Message:

Canonical: when /%post_id%/ is the permalink structure, don't redirect IDs that match Auto Drafts.

Props SergeyBiryukov.
Fixes #29431.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/canonical.php

    r35331 r35480  
    118118        if ( $id && $redirect_post = get_post($id) ) {
    119119            $post_type_obj = get_post_type_object($redirect_post->post_type);
    120             if ( $post_type_obj->public ) {
     120            if ( $post_type_obj->public && 'auto-draft' != $redirect_post->post_status ) {
    121121                $redirect_url = get_permalink($redirect_post);
    122122                $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url );
Note: See TracChangeset for help on using the changeset viewer.