|
@@ 1964-1972 (lines=9) @@
|
| 1961 |
|
$q['p'] = absint($q['attachment_id']); |
| 1962 |
|
|
| 1963 |
|
// If a post number is specified, load that post |
| 1964 |
|
if ( $q['p'] ) { |
| 1965 |
|
$where .= " AND {$wpdb->posts}.ID = " . $q['p']; |
| 1966 |
|
} elseif ( $q['post__in'] ) { |
| 1967 |
|
$post__in = implode(',', array_map( 'absint', $q['post__in'] )); |
| 1968 |
|
$where .= " AND {$wpdb->posts}.ID IN ($post__in)"; |
| 1969 |
|
} elseif ( $q['post__not_in'] ) { |
| 1970 |
|
$post__not_in = implode(',', array_map( 'absint', $q['post__not_in'] )); |
| 1971 |
|
$where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; |
| 1972 |
|
} |
| 1973 |
|
|
| 1974 |
|
if ( is_numeric( $q['post_parent'] ) ) { |
| 1975 |
|
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_parent = %d ", $q['post_parent'] ); |
|
@@ 1974-1982 (lines=9) @@
|
| 1971 |
|
$where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; |
| 1972 |
|
} |
| 1973 |
|
|
| 1974 |
|
if ( is_numeric( $q['post_parent'] ) ) { |
| 1975 |
|
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_parent = %d ", $q['post_parent'] ); |
| 1976 |
|
} elseif ( $q['post_parent__in'] ) { |
| 1977 |
|
$post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) ); |
| 1978 |
|
$where .= " AND {$wpdb->posts}.post_parent IN ($post_parent__in)"; |
| 1979 |
|
} elseif ( $q['post_parent__not_in'] ) { |
| 1980 |
|
$post_parent__not_in = implode( ',', array_map( 'absint', $q['post_parent__not_in'] ) ); |
| 1981 |
|
$where .= " AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)"; |
| 1982 |
|
} |
| 1983 |
|
|
| 1984 |
|
if ( $q['page_id'] ) { |
| 1985 |
|
if ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) { |