rest_insert_attachment
do_action( ‘rest_insert_attachment’, WP_Post $attachment , WP_REST_Request $request , bool $creating )
动作钩子::通过REST API创建或更新单个附件后激发。Action Hook: Fires after a single attachment is created or updated via the REST API.
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$attachment | (WP_Post) | 插入或更新的附件对象。 |
$request | (WP_REST_Request) | 发送到API的请求。 |
$creating | (bool) | 创建附件时为True,更新时为false。 |
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.7.0 | wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:292 | 1 | 0 |
上一篇: rest_index
下一篇: rest_insert_comment
总计 0 评论