wp_update_post


wp_update_post ( $postarr = array(), $wp_error = false )

Parameters:
  • (array|object) postarr Optional. Post data. Arrays are expected to be escaped, objects are not. Default array.
  • (bool) wp_error Optional. Allow return of WP_Error on failure. Default false.
Returns:
  • (int|WP_Error) The post ID on success. The value 0 or WP_Error on failure.
Defined at:

Description

Update a post with new post data.The date does not have to be set for drafts. You can set the date and it will not be overridden.

Related Functions

wp_update_site, wp_update_term, wp_update_user, wp_update_core, wp_delete_post

Top Google Results

User discussions

wpseek mobile