|
@@ 2756-2764 (lines=9) @@
|
| 2753 |
|
$q['p'] = absint($q['attachment_id']); |
| 2754 |
|
|
| 2755 |
|
// If a post number is specified, load that post |
| 2756 |
|
if ( $q['p'] ) { |
| 2757 |
|
$where .= " AND {$wpdb->posts}.ID = " . $q['p']; |
| 2758 |
|
} elseif ( $q['post__in'] ) { |
| 2759 |
|
$post__in = implode(',', array_map( 'absint', $q['post__in'] )); |
| 2760 |
|
$where .= " AND {$wpdb->posts}.ID IN ($post__in)"; |
| 2761 |
|
} elseif ( $q['post__not_in'] ) { |
| 2762 |
|
$post__not_in = implode(',', array_map( 'absint', $q['post__not_in'] )); |
| 2763 |
|
$where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; |
| 2764 |
|
} |
| 2765 |
|
|
| 2766 |
|
if ( is_numeric( $q['post_parent'] ) ) { |
| 2767 |
|
$where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] ); |
|
@@ 2766-2774 (lines=9) @@
|
| 2763 |
|
$where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; |
| 2764 |
|
} |
| 2765 |
|
|
| 2766 |
|
if ( is_numeric( $q['post_parent'] ) ) { |
| 2767 |
|
$where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] ); |
| 2768 |
|
} elseif ( $q['post_parent__in'] ) { |
| 2769 |
|
$post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) ); |
| 2770 |
|
$where .= " AND {$wpdb->posts}.post_parent IN ($post_parent__in)"; |
| 2771 |
|
} elseif ( $q['post_parent__not_in'] ) { |
| 2772 |
|
$post_parent__not_in = implode( ',', array_map( 'absint', $q['post_parent__not_in'] ) ); |
| 2773 |
|
$where .= " AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)"; |
| 2774 |
|
} |
| 2775 |
|
|
| 2776 |
|
if ( $q['page_id'] ) { |
| 2777 |
|
if ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) { |