wppaste
WordPress

do_action( 'wp_creating_autosave', array $new_autosave, bool $is_update )

Since
4.1.0, 6.4.0
Fires before an autosave is stored.

Compatibility

WordPress
since 6.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$new_autosavearray
Post array - the autosave that is about to be saved.
$is_updatebool
Whether this is an existing autosave.

Where this hook fires · 3

  • wp-admin/includes/post.php:2009wp_create_post_autosave()
  • wp-admin/includes/post.php:2022wp_create_post_autosave()
  • wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php:416WP_REST_Autosaves_Controller::create_post_autosave()

Source code

		 * @since 4.1.0		 * @since 6.4.0 The `$is_update` parameter was added to indicate if the autosave is being updated or was newly created.		 *		 * @param array $new_autosave Post array - the autosave that is about to be saved.		 * @param bool  $is_update    Whether this is an existing autosave.		 */		do_action( 'wp_creating_autosave', $new_autosave, true );		return wp_update_post( $new_autosave );	} 	// _wp_put_post_revision() expects unescaped.	$post_data = wp_unslash( $post_data );

Changelog

Introduced in 4.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.4.0
The $is_update parameter was added to indicate if the autosave is being updated or was newly created.from the docblock
4.1.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.