attachment_fields_to_edit

attachment_fields_to_edit

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('attachment_fields_to_edit') is found 2 times:

  • /wp-admin/includes/media.php line 1509
    	 *
    	 * @param array   $form_fields An array of attachment form fields.
    	 * @param WP_Post $post        The WP_Post attachment object.
    	 */
    	$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
    
    	return $form_fields;
    }
    
    /**
     * Retrieves HTML for media items of post gallery.
    
  • /wp-admin/includes/media.php line 1934
    	 */
    	$form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] );
    
    	/** This filter is documented in wp-admin/includes/media.php */
    	$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
    
    	unset(
    		$form_fields['image-size'],
    		$form_fields['align'],
    		$form_fields['image_alt'],
    		$form_fields['post_title'],
    

See this hook used in plugins: