media_single_attachment_fields_to_edit

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

Description

(array) media_single_attachment_fields_to_edit( (array) $form_fields, (WP_Post) $post ); 

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

  1. if ( !function_exists( 'media_single_attachment_fields_to_edit' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/media.php'; 
  3.  
  4. // An array of attachment form fields. 
  5. $form_fields = array(); 
  6.  
  7. // The WP_Post attachment object. 
  8. $post = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = media_single_attachment_fields_to_edit($form_fields, $post); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/media.php  
  1. function media_single_attachment_fields_to_edit( $form_fields, $post ) { 
  2. unset($form_fields['url'], $form_fields['align'], $form_fields['image-size']); 
  3. return $form_fields;