mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +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:
@@ -976,7 +976,7 @@ function get_page_by_path($page_path, $output = OBJECT) {
|
||||
foreach($page_paths as $pathdir)
|
||||
$full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
|
||||
|
||||
$pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND post_type='page'", $leaf_path ));
|
||||
$pages = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM $wpdb->posts WHERE post_name = %s AND (post_type = 'page' OR post_type = 'attachment')", $leaf_path ));
|
||||
|
||||
if ( empty($pages) )
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user