attachment_fields_to_edit WordPress Filter Hook
The attachment_fields_to_edit hook is used to add custom fields to the attachment edit screen in the WordPress admin. This hook can be used to add fields for extra data to be stored with an attachment, such as credit information or a link to the original file.
apply_filters( 'attachment_fields_to_edit', array $form_fields , WP_Post $post ) #
Filters the attachment fields to edit.
Parameters
More Information
- WordPress does not pass standard fields through this filter, though this can still be used for adding attachment form fields.
- Note that the filter function must return an array of attachment form fields after it is finished processing; otherwise, no fields will be displayed when editing an attachment and other plugins also filtering the
$form_fields
array may generate errors.
Source
Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |