Skip to content

Commit

Permalink
Bug fix: Redirect cache was being updated only on transition_post_sta…
Browse files Browse the repository at this point in the history
…tus which is called BEFORE save_post. However, save_post is where all the important info is saved so we need to update cache after it.
  • Loading branch information
tlovett1 committed Oct 10, 2012
1 parent 8dae4a6 commit b99d37d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions safe-redirect-manager.php
Expand Up @@ -479,6 +479,13 @@ public function action_save_post( $post_id ) {
} else {
delete_post_meta( $post_id, $this->meta_key_redirect_status_code );
}

/**
* This fixes an important bug where the redirect cache was not up-to-date. Previously the cache was only being
* updated on transition_post_status which gets called BEFORE save post. But since save_post is where all the important
* redirect info is saved, updating the cache before it is not sufficient.
*/
$this->update_redirect_cache();
}
}

Expand Down

1 comment on commit b99d37d

@danielbachhuber
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw this in my testing too but forgot to log it. Good catch.

Please sign in to comment.