rest_after_insert_{$this->post_type}
do_action( “rest_after_insert_{$this->post_type}”, WP_Post $post , WP_REST_Request $request , bool $creating )
动作钩子::在通过REST API完全创建或更新一个post之后激发。
Action Hook: Fires after a single post is completely created or updated via the REST API.
说明(Description)
钩子名的动态部分,$this->post_type,是指post type slug。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$post | (WP_Post) | 插入或更新的post对象。 |
$request | (WP_REST_Request) | 请求对象。 |
$creating | (bool) | 创建帖子时为True,更新时为false。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
5.0.0 | wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:678 | 2 | 0 |
rest_after_insert_{$this->post_type} 为WP2原创文章,链接:https://www.wp2.cn/hook/rest_after_insert_this-post_type/