Do not store empty _wp_old_slug values. fixes #15736

git-svn-id: http://svn.automattic.com/wordpress/trunk@16820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2010-12-08 21:22:16 +00:00
parent 298c858c5b
commit c1a0cf30c3
1 changed files with 1 additions and 1 deletions

View File

@ -4031,7 +4031,7 @@ function wp_check_for_changed_slugs($post_id, $post, $post_before) {
$old_slugs = (array) get_post_meta($post_id, '_wp_old_slug');
// if we haven't added this old slug before, add it now
if ( !in_array($post_before->post_name, $old_slugs) )
if ( !empty( $post_before->post_name ) && !in_array($post_before->post_name, $old_slugs) )
add_post_meta($post_id, '_wp_old_slug', $post_before->post_name);
// if the new slug was used previously, delete it from the list