image_attachment_fields_to_save()
image_attachment_fields_to_save( array $post, array $attachment )
从媒体上载表单处理程序()中筛选输入,如果未提供,则从文件名中分配默认的日志标题。
Filters input from media_upload_form_handler() and assigns a default post_title from the file name if none supplied.
说明(Description)
说明了“attachment_fields_to_save”筛选器的使用,该筛选器可用于在保存到数据库之前向任何字段添加默认值。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post | (array) | 必需 | WP_Post attachment对象已转换为数组。 |
$attachment | (array) | 必需 | 附件元数据数组。 |
返回(Return)
(array)筛选的附件发布对象。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.5.0 | wp-admin/includes/media.php:1305 | 0 | 2 |
image_attachment_fields_to_save() 为WP2原创文章,链接:https://www.wp2.cn/functions/image_attachment_fields_to_save/