mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-23 14:54:33 +00:00
Query page attachments from page requests so that they can both use the same set of rewrite rules. see #3614
git-svn-id: https://develop.svn.wordpress.org/trunk@6377 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -841,6 +841,12 @@ class WP_Query {
|
||||
$q['pagename'] = sanitize_title(basename($page_paths));
|
||||
$q['name'] = $q['pagename'];
|
||||
$where .= " AND (ID = '$reqpage')";
|
||||
$reqpage_obj = get_page($reqpage);
|
||||
if ( 'attachment' == $reqpage_obj->post_type ) {
|
||||
$this->is_attachment = true;
|
||||
$this->is_page = false;
|
||||
$q['attachment_id'] = $reqpage;
|
||||
}
|
||||
}
|
||||
} elseif ('' != $q['attachment']) {
|
||||
$q['attachment'] = str_replace('%2F', '/', urlencode(urldecode($q['attachment'])));
|
||||
|
||||
Reference in New Issue
Block a user