From 1c5b8abe659db21528da7ff3eeca0f6781d372a0 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Sat, 25 Oct 2003 22:06:11 +0000 Subject: [PATCH] Add post_name column, populate column. git-svn-id: https://develop.svn.wordpress.org/trunk@466 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/upgrade-072-to-073.php | 86 ++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/wp-admin/upgrade-072-to-073.php b/wp-admin/upgrade-072-to-073.php index 3cc4573c94..6777e9331e 100644 --- a/wp-admin/upgrade-072-to-073.php +++ b/wp-admin/upgrade-072-to-073.php @@ -1,5 +1,87 @@ + + +WordPress›.72 to .73 Upgrade + + + +

WordPress

+ \ No newline at end of file + case 0: +?> +

This file seeks to upgrade you to the latest version of WordPress. If you are upgrading from any version other than .72, you should run the previous upgrade files to get everything up to date before running this.

+

If you’re all ready, let's go!

+ +

Step 1

+

If it isn't there already, let's add a field new to this version.

+hide_errors(); +$wpdb->query("ALTER TABLE `$tableposts` ADD INDEX (`post_name`)"); +$wpdb->show_errors(); +?> +

Done.

+

Now let's populate the new field.

+

Working + get_results("SELECT ID, post_title, post_name FROM $tableposts"); + +foreach($posts as $post) { + if ('' == $post->post_name) { + $newtitle = sanitize_title($post->post_title); + $wpdb->query("UPDATE $tableposts SET post_name = '$newtitle' WHERE ID = $post->ID"); + } + echo ' .'; + flush(); +} + +?> + Done.

+

See, that didn't hurt a bit. All done!

+ + + \ No newline at end of file