wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_save_post_revision_on_insert › WordPress Function

Depuis6.4.0
Dépréciéen/a
wp_save_post_revision_on_insert ( $post_id, $post, $update )
Paramètres: (3)
  • (int) $post_id The post id that was inserted.
    Requis: Oui
  • (WP_Post) $post The post object that was inserted.
    Requis: Oui
  • (bool) $update Whether this insert is updating an existing post.
    Requis: Oui
Défini(e) dans:
Codex:

Saves revisions for a post after all changes have been made.



Source

function wp_save_post_revision_on_insert( $post_id, $post, $update ) {
	if ( ! $update ) {
		return;
	}

	if ( ! has_action( 'post_updated', 'wp_save_post_revision' ) ) {
		return;
	}

	wp_save_post_revision( $post_id );
}