mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
298c858c5b
commit
c1a0cf30c3
@ -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');
|
$old_slugs = (array) get_post_meta($post_id, '_wp_old_slug');
|
||||||
|
|
||||||
// if we haven't added this old slug before, add it now
|
// 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);
|
add_post_meta($post_id, '_wp_old_slug', $post_before->post_name);
|
||||||
|
|
||||||
// if the new slug was used previously, delete it from the list
|
// if the new slug was used previously, delete it from the list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user