Ticket #6492: uuid.diff
File uuid.diff, 3.0 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/upgrade.php
93 93 // First post 94 94 $now = date('Y-m-d H:i:s'); 95 95 $now_gmt = gmdate('Y-m-d H:i:s'); 96 $first_post_guid = get_option('home') . '/?p=1';96 $first_post_guid = $wpdb->get_var('SELECT UUID()'); 97 97 $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, comment_count, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '', '".$wpdb->escape(__('Hello world!'))."', '0', '".$wpdb->escape(_c('hello-world|Default post slug'))."', '$now', '$now_gmt', '$first_post_guid', '1', '', '', '')"); 98 98 $wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 1)" ); 99 99 … … 101 101 $wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('1', '".$wpdb->escape(__('Mr WordPress'))."', '', 'http://wordpress.org/', '$now', '$now_gmt', '".$wpdb->escape(__('Hi, this is a comment.<br />To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.'))."')"); 102 102 103 103 // First Page 104 $first_post_guid = get_option('home') . '/?page_id=2';104 $first_post_guid = $wpdb->get_var('SELECT UUID()'); 105 105 $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(_c('about|Default page slug'))."', '$now', '$now_gmt','$first_post_guid', 'publish', 'page', '', '', '')"); 106 106 } 107 107 endif; -
wp-includes/post.php
1301 1301 clean_post_cache($post_ID); 1302 1302 1303 1303 // Set GUID 1304 if ( !$update && '' == $current_guid ) 1305 $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where ); 1304 if ( !$update && '' == $current_guid ) { 1305 // get a UUID 1306 $uuid = $wpdb->get_var('SELECT UUID();'); 1307 $wpdb->update( $wpdb->posts, array( 'guid' => $uuid ), $where ); 1308 } 1306 1309 1307 1310 $post = get_post($post_ID); 1308 1311