Title: save_post hook help (post_status)
Last modified: August 21, 2016

---

# save_post hook help (post_status)

 *  [jspitz725](https://wordpress.org/support/users/jspitz725/)
 * (@jspitz725)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/save_post-hook-help-post_status/)
 * Hi,
 * I’m trying to get the post_status of a post before it is updated in the database.
   If I hook into save_post, I’m hoping that the post_status will have already been
   changed to publish. Am I correct?
 * Essentially, I have this hack where I modify the post content, but only when 
   a post is published or updated. I don’t want to modify the post content if the
   post is a draft or a preview or anything of that sort.
 * How can I check this on the fly? I’ve tried get_post_status(”), but let’s say
   I’m working on a draft…get_post_status(”) == ‘draft’ and when I click publish,
   my code still considers it as a draft until the page gets refreshed (then it 
   considers it as published).
 * Sorry for the confusing question and thank you in advance for any help. I can
   clarify any questions.
 * Thanks

The topic ‘save_post hook help (post_status)’ is closed to new replies.

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [post](https://wordpress.org/support/topic-tag/post/)
 * [post_status](https://wordpress.org/support/topic-tag/post_status/)
 * [save](https://wordpress.org/support/topic-tag/save/)
 * [save_post](https://wordpress.org/support/topic-tag/save_post/)
 * [status](https://wordpress.org/support/topic-tag/status/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [jspitz725](https://wordpress.org/support/users/jspitz725/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/save_post-hook-help-post_status/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
