Do not store empty _wp_old_slug values. fixes #15736

git-svn-id: https://develop.svn.wordpress.org/trunk@16820 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2010-12-08 21:22:16 +00:00
parent 956b191c60
commit b105838594
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