Changeset 3200
- Timestamp:
- 11/23/2005 01:35:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions-post.php
r3190 r3200 8 8 function wp_insert_post($postarr = array()) { 9 9 global $wpdb, $allowedtags, $user_ID; 10 11 if ( is_object($postarr) ) 12 $postarr = get_object_vars($postarr); 10 13 11 14 // export array as variables … … 197 200 function wp_insert_attachment($object, $file, $post_parent = 0) { 198 201 global $wpdb, $user_ID; 202 203 if ( is_object($object) ) 204 $object = get_object_vars($object); 199 205 200 206 // Export array as variables … … 222 228 $post_status = 'attachment'; 223 229 224 // Get the post ID. 225 if ( $update ) 226 $post_ID = $ID; 230 // Are we updating or creating? 231 $update = false; 232 if ( !empty($ID) ) { 233 $update = true; 234 $post_ID = $ID; 235 } 227 236 228 237 // Create a valid post name. … … 379 388 global $wpdb; 380 389 390 if ( is_object($postarr) ) 391 $postarr = get_object_vars($postarr); 392 381 393 // First, get all of the original fields 382 394 $post = wp_get_single_post($postarr['ID'], ARRAY_A);
Note: See TracChangeset
for help on using the changeset viewer.