Ticket #5256: 5256.diff

File 5256.diff, 0.6 kB (added by DD32, 11 months ago)
  • wp-includes/query.php

    old new  
    868868 
    869869                // If a post number is specified, load that post 
    870870                if ( $q['p'] ) 
    871                         $where = ' AND ID = ' . $q['p']; 
     871                        $where = " AND {$wpdb->posts}.ID = " . $q['p']; 
    872872 
    873873                if ( $q['page_id'] ) { 
    874874                        if  ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) { 
    875875                                $q['p'] = $q['page_id']; 
    876                                 $where = ' AND ID = ' . $q['page_id']; 
     876                                $where = " AND {$wpdb->posts}.ID = " . $q['page_id']; 
    877877                        } 
    878878                } 
    879879