mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
In WP::parse_request() and url_to_postid(), if a post slug clashes with a trashed page, return the post instead of the page.
Props kovshenin, SergeyBiryukov, igmoweb. Fixes #21970. git-svn-id: https://develop.svn.wordpress.org/trunk@35195 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -209,8 +209,15 @@ class WP {
|
||||
|
||||
if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) {
|
||||
// This is a verbose page match, let's check to be sure about it.
|
||||
if ( ! get_page_by_path( $matches[ $varmatch[1] ] ) )
|
||||
$page = get_page_by_path( $matches[ $varmatch[1] ] );
|
||||
if ( ! $page ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$post_status_obj = get_post_status_object( $page->post_status );
|
||||
if ( ! $post_status_obj->public && ! $post_status_obj->protected && ! $post_status_obj->private ) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Got a match.
|
||||
|
||||
Reference in New Issue
Block a user