wp_check_for_changed_dates ( $post_id, $post, $post_before )
- (int) post_id Post ID.
- (WP_Post) post The Post Object
- (WP_Post) post_before The Previous Post Object
- Introduced in WordPress: 4.9.3
- Deprecated in WordPress: —
Check for changed dates for published post objects and save the old date.The function is used when a post object of any type is updated,
by comparing the current and previous post objects.
If the date was changed and not already part of the old dates then it will be
added to the post meta field ('_wp_old_date') for storing old dates for that
The most logically usage of this function is redirecting changed post objects, so
that those that linked to an changed post will be redirected to the new post.