wp_creating_autosave
Fires before an autosave is stored.
Использование
add_action( 'wp_creating_autosave', 'wp_kama_creating_autosave_action', 10, 2 ); /** * Function for `wp_creating_autosave` action-hook. * * @param array $new_autosave Post array - the autosave that is about to be saved. * @param bool $is_update Whether this is an existing autosave. * * @return void */ function wp_kama_creating_autosave_action( $new_autosave, $is_update ){ // action... }
- $new_autosave(массив)
- Post array - the autosave that is about to be saved.
- $is_update(true|false)
- Whether this is an existing autosave.
Список изменений
С версии 4.1.0 | Введена. |
С версии 6.4.0 | The $is_update parameter was added to indicate if the autosave is being updated or was newly created. |
Где вызывается хук
wp_creating_autosave
wp_creating_autosave
wp-admin/includes/post.php 1991
do_action( 'wp_creating_autosave', $new_autosave, true );
wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php 412
do_action( 'wp_creating_autosave', $new_autosave );
wp-admin/includes/post.php 2004
do_action( 'wp_creating_autosave', get_post( $revision, ARRAY_A ), false );
Где используется хук в WordPress
wp-includes/default-filters.php 747
add_action( 'wp_creating_autosave', 'wp_autosave_post_revisioned_meta_fields' );