Changeset 10150 for trunk/wp-includes/post.php
- Timestamp:
- 12/09/2008 06:03:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r10130 r10150 204 204 * @param int|object $post Post ID or post object. 205 205 * @param string $output Optional, default is Object. Either OBJECT, ARRAY_A, or ARRAY_N. 206 * @param string $filter Optional, default is raw. 206 * @param string $filter Optional, default is raw. 207 207 * @return mixed Post data 208 208 */ … … 2162 2162 2163 2163 } 2164 2165 if ( $parent >= 0 ) 2166 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 2167 2164 2165 if ( $parent >= 0 ) 2166 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 2167 2168 2168 $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where "; 2169 2169 $query .= $author_query; … … 2185 2185 if ( !empty($exclude_tree) ) { 2186 2186 $exclude = array(); 2187 2187 2188 2188 $exclude = (int) $exclude_tree; 2189 2189 $children = get_page_children($exclude, $pages); … … 2380 2380 } else { 2381 2381 // If there is a suggested ID, use it if not already present 2382 if ( !empty($import_id) ) { 2383 $import_id = (int) $import_id; 2384 if ( ! $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE ID = %d", $import_id) ) ) { 2385 $data['ID'] = $import_id; 2386 } 2387 } 2382 if ( !empty($import_id) ) { 2383 $import_id = (int) $import_id; 2384 if ( ! $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE ID = %d", $import_id) ) ) { 2385 $data['ID'] = $import_id; 2386 } 2387 } 2388 2388 2389 2389 $wpdb->insert( $wpdb->posts, $data );
Note: See TracChangeset
for help on using the changeset viewer.