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.
Built from https://develop.svn.wordpress.org/trunk@35205


git-svn-id: http://core.svn.wordpress.org/trunk@35171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-10-15 17:53:24 +00:00
parent 395258bcaa
commit 2d540d0280
3 changed files with 5 additions and 3 deletions

View File

@ -215,7 +215,8 @@ class WP {
}
$post_status_obj = get_post_status_object( $page->post_status );
if ( ! $post_status_obj->public && ! $post_status_obj->protected && ! $post_status_obj->private ) {
if ( ! $post_status_obj->public && ! $post_status_obj->protected
&& ! $post_status_obj->private && $post_status_obj->exclude_from_search ) {
continue;
}
}

View File

@ -403,7 +403,8 @@ function url_to_postid( $url ) {
}
$post_status_obj = get_post_status_object( $page->post_status );
if ( ! $post_status_obj->public && ! $post_status_obj->protected && ! $post_status_obj->private ) {
if ( ! $post_status_obj->public && ! $post_status_obj->protected
&& ! $post_status_obj->private && $post_status_obj->exclude_from_search ) {
continue;
}
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-35204';
$wp_version = '4.4-alpha-35205';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.