From 8cbdbb7d1675aae3d6dd1fb0e8e77919e3e5d7ef Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sat, 25 Oct 2003 22:06:11 +0000 Subject: [PATCH] Add post_name column, populate column. git-svn-id: http://svn.automattic.com/wordpress/trunk@466 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 3cc4573c9..6777e9331 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