Changeset 6593
- Timestamp:
- 01/10/2008 09:27:08 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/rss.php
r6472 r6593 72 72 } 73 73 74 preg_match('|<guid. +?>(.*?)</guid>|is', $post, $guid);74 preg_match('|<guid.*?>(.*?)</guid>|is', $post, $guid); 75 75 if ($guid) 76 76 $guid = $wpdb->escape(trim($guid[1])); -
trunk/wp-includes/post.php
r6592 r6593 953 953 $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID, 954 954 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 955 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => ''); 955 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 956 'guid' => ''); 956 957 957 958 $postarr = wp_parse_args($postarr, $defaults); … … 987 988 $post_type = 'post'; 988 989 989 // Get the post ID .990 if ( $update ) 990 // Get the post ID and GUID 991 if ( $update ) { 991 992 $post_ID = (int) $ID; 992 993 $guid = get_post_field( 'guid', $post_ID ); 994 } 995 993 996 // Create a valid post name. Drafts are allowed to have an empty 994 997 // post name. … … 1075 1078 1076 1079 // expected_slashed (everything!) 1077 $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order' ) );1080 $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) ); 1078 1081 $data = stripslashes_deep( $data ); 1079 1082 $where = array( 'ID' => $post_ID ); … … 1098 1101 wp_set_post_tags( $post_ID, $tags_input ); 1099 1102 1103 $current_guid = get_post_field( 'guid', $post_ID ); 1104 1100 1105 if ( 'page' == $post_type ) { 1101 1106 clean_page_cache($post_ID); … … 1105 1110 1106 1111 // Set GUID 1107 if ( ! $update)1112 if ( !$update && '' == $current_guid ) 1108 1113 $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where ); 1109 1114 … … 2544 2549 2545 2550 if ( $old_status != 'publish' && $new_status == 'publish' ) { 2546 // Reset GUID if transitioning to publish. 2551 // Reset GUID if transitioning to publish and it is empty 2552 if ( '' == get_the_guid($post->ID) ) 2547 2553 $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); 2548 2554 do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish 2549 2555 } 2550 2556
Note: See TracChangeset
for help on using the changeset viewer.