media_post_single_attachment_fields_to_edit
Retrieves the post non-image attachment fields to edito form fields.
Description
Returns (array)
Filtered attachment form fields.
Parameters (2)
- 0. $form_fields (array)
- An array of attachment form fields.
- 1. $post (WP_Post)
- The
WP_Post
attachment object.
Usage
if ( !function_exists( 'media_post_single_attachment_fields_to_edit' ) ) { require_once ABSPATH . '/wp-admin/includes/media.php'; } // An array of attachment form fields. $form_fields = array(); // The WP_Post attachment object. $post = null; // NOTICE! Understand what this does before running. $result = media_post_single_attachment_fields_to_edit($form_fields, $post);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/media.php
- function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
- unset($form_fields['image_url']);
- return $form_fields;
- }