Codex tools: Log in
Checked for changed slugs for published posts and save old slug.
The function is used along with form POST data. It checks for the wp-old-slug POST field. Will only be concerned with published posts and the slug actually changing.
If the slug was changed and not already part of the old slugs then it will be added to the post meta field ('_wp_old_slug') for storing old slugs for that post.
The most logically usage of this function is redirecting changed posts, so that those that linked to an changed post will be redirected to the new post.
<?php wp_check_for_changed_slugs( $post_id ); ?>
wp_check_for_changed_slugs() is located in