WordPress.org

Make WordPress Core

Changeset 35205


Ignore:
Timestamp:
10/15/2015 05:52:36 PM (6 years ago)
Author:
SergeyBiryukov
Message:

In WP::parse_request() and url_to_postid(), don't skip objects that have a post status with 'exclude_from_search' => false, e.g. inherit.

This fixes pretty permalinks for attachments, broken in [35195].

Fixes #21970.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r35195 r35205  
    216216
    217217                            $post_status_obj = get_post_status_object( $page->post_status );
    218                             if ( ! $post_status_obj->public && ! $post_status_obj->protected && ! $post_status_obj->private ) {
     218                            if ( ! $post_status_obj->public && ! $post_status_obj->protected
     219                                && ! $post_status_obj->private && $post_status_obj->exclude_from_search ) {
    219220                                continue;
    220221                            }
  • trunk/src/wp-includes/rewrite-functions.php

    r35195 r35205  
    404404
    405405                $post_status_obj = get_post_status_object( $page->post_status );
    406                 if ( ! $post_status_obj->public && ! $post_status_obj->protected && ! $post_status_obj->private ) {
     406                if ( ! $post_status_obj->public && ! $post_status_obj->protected
     407                    && ! $post_status_obj->private && $post_status_obj->exclude_from_search ) {
    407408                    continue;
    408409                }
Note: See TracChangeset for help on using the changeset viewer.