Changeset 8732 for trunk/wp-includes/post.php
- Timestamp:
- 08/25/2008 09:50:11 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r8702 r8732 124 124 125 125 $children = get_posts( $r ); 126 if ( !$children ) 127 return false; 126 if ( !$children ) { 127 $kids = false; 128 return $kids; 129 } 128 130 129 131 update_post_cache($children); … … 777 779 return $post; 778 780 if ( is_object($post) ) { 781 if ( !isset($post->ID) ) 782 $post->ID = 0; 779 783 foreach ( array_keys(get_object_vars($post)) as $field ) 780 784 $post->$field = sanitize_post_field($field, $post->$field, $post->ID, $context); 781 785 } else { 786 if ( !isset($post['ID']) ) 787 $post['ID'] = 0; 782 788 foreach ( array_keys($post) as $field ) 783 789 $post[$field] = sanitize_post_field($field, $post[$field], $post['ID'], $context); … … 1317 1323 1318 1324 // Make sure we set a valid category 1319 if ( 0 == count($post_category) || !is_array($post_category)) {1325 if ( empty($post_category) || 0 == count($post_category) || !is_array($post_category) ) { 1320 1326 $post_category = array(get_option('default_category')); 1321 1327 } … … 1329 1335 if ( empty($post_type) ) 1330 1336 $post_type = 'post'; 1337 1338 $post_ID = 0; 1331 1339 1332 1340 // Get the post ID and GUID … … 1433 1441 } 1434 1442 } else { 1435 $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update 1443 if ( isset($post_mime_type) ) 1444 $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update 1436 1445 if ( false === $wpdb->insert( $wpdb->posts, $data ) ) { 1437 1446 if ( $wp_error )
Note: See TracChangeset
for help on using the changeset viewer.