Title: Update Page Button
Last modified: August 21, 2016

---

# Update Page Button

 *  Resolved [jankowski](https://wordpress.org/support/users/jankowski/)
 * (@jankowski)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/)
 * What WordPress function is called when the “Update Page” button is clicked, and
   in what file can I find that definition?
 * Thanks for any help, apologies if this isn’t the proper forum!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032880)
 * wp_update_post does the update stuff. If you’re looking to do something when 
   a post is saved, it’s probably better to use the [save_post hook](http://codex.wordpress.org/Plugin_API/Action_Reference/save_post).
 *  Thread Starter [jankowski](https://wordpress.org/support/users/jankowski/)
 * (@jankowski)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032881)
 * Thanks, tried `wp_update_post`, didn’t work quite as I had hoped. To be a bit
   more specific about my problem, I’m manually creating a page using a PHP command
   line script, and I’m trying to have certain privacy settings from the plugin 
   User Access Manager be applied to that page. With just my script, the settings
   are not properly applied. However, when I go onto the WordPress editor on my 
   site and simply click the “Update Page” button for the page without doing anything
   else, the settings suddenly activate. I’m sure there’s some function within the
   plugin source code that would help, but it’s quite an extensive set of files,
   and I’m just trying to have the page update itself from the PHP script as a bit
   of a shortcut. When I tried `wp_update_post()` in different parts of the script,
   nothing new happened.
 * Do you know if any other functions are called when the button is clicked? (Thank
   you for the response!)
 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032886)
 * `wp_update_post` calls `wp_insert_post`. The previously mentioned `save_post`
   hook runs, and is commonly used to do things during post events.
 *  Thread Starter [jankowski](https://wordpress.org/support/users/jankowski/)
 * (@jankowski)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032887)
 * So if I’m using `wp_insert_post` already in my code, I should try to find where,
   in the plugin source code, the author uses `add_action('save_post, etc. etc.)`
   and try to use that function?
 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032892)
 * Yes, that’s a good start. You’ll likely have to bootstrap the plugin to get access
   to all the data it needs to do the function(s). This can get kinda tricky. I 
   suggest reaching out to the plugin author to see if he has any recommendations
   for doing this.
 *  Thread Starter [jankowski](https://wordpress.org/support/users/jankowski/)
 * (@jankowski)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032899)
 * Okay, thanks! Yeah, he’s been okay about getting back to me but hasn’t responded
   lately.
 * Thank you for your help!
 *  Thread Starter [jankowski](https://wordpress.org/support/users/jankowski/)
 * (@jankowski)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032989)
 * Fixed with `wp_set_current_user()`

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Update Page Button’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [source-code](https://wordpress.org/support/topic-tag/source-code/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [jankowski](https://wordpress.org/support/users/jankowski/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/update-page-button/#post-4032989)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
