media_post_single_attachment_fields_to_edit() WordPress Function

This function allows you to add custom fields to the default WordPress media attachment fields. This can be useful for adding extra data to an attachment, such as copyright information or a link to the original file.

media_post_single_attachment_fields_to_edit( array $form_fields, WP_Post $post ) #

Retrieves the post non-image attachment fields to edit form fields.


Parameters

$form_fields

(array)(Required)An array of attachment form fields.

$post

(WP_Post)(Required)The WP_Post attachment object.


Top ↑

Return

(array) Filtered attachment form fields.


Top ↑

Source

File: wp-admin/includes/media.php

function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
	unset( $form_fields['image_url'] );
	return $form_fields;
}

Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More