wp_save_post_revision_on_insert

函数
wp_save_post_revision_on_insert ( $post_id, $post, $update )
参数
  • (int) $post_id The post id that was inserted.
    Required:
  • (WP_Post) $post The post object that was inserted.
    Required:
  • (bool) $update Whether this insert is updating an existing post.
    Required:
定义位置
相关方法
wp_save_post_revisionwp_restore_post_revision_metawp_get_post_revisionswp_is_post_revisionwp_list_post_revisions
引入
6.4.0
弃用
-

在完成所有修改后,保存对文章的修订。

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 );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 11:36:30

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: