Make WordPress Core


Ignore:
Timestamp:
12/12/2007 11:45:55 AM (17 years ago)
Author:
ryan
Message:

Query page attachments from page requests so that they can both use the same set of rewrite rules. see #3614

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r6364 r6377  
    977977        $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
    978978
    979     $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 ));
     979    $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 ));
    980980
    981981    if ( empty($pages) )
Note: See TracChangeset for help on using the changeset viewer.