From 2d540d02803bc34bf03e785aabbb1b9b67178929 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 15 Oct 2015 17:53:24 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp.php | 3 ++- wp-includes/rewrite-functions.php | 3 ++- wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index 4acadadca1..4a3b42c795 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -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; } } diff --git a/wp-includes/rewrite-functions.php b/wp-includes/rewrite-functions.php index 2f9be5ad99..829df3d1a5 100644 --- a/wp-includes/rewrite-functions.php +++ b/wp-includes/rewrite-functions.php @@ -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; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 205dc16c0a..e8926c27c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.