Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: attachment_fields_to_edit

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
1501
1502      /**
1503       * Filters the attachment fields to edit.
1504       *
1505       * @since 2.5.0
1506       *
1507       * @param array   $form_fields An array of attachment form fields.
1508       * @param WP_Post $post        The WP_Post attachment object.
1509       */
1510      $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
1511
1512      return $form_fields;
1513 }
1514
1515 /**
1516  * Retrieve HTML for media items of post gallery.
1517  *
1518  * The HTML markup retrieved will be created for the progress of SWF Upload
1519  * component. Will also create link for showing and hiding the form to modify
 
Line Code
1927      /*
1928       * Merge default fields with their errors, so any key passed with the error
1929       * (e.g. 'error', 'helps', 'value') will replace the default.
1930       * The recursive merge is easily traversed with array casting:
1931       * foreach ( (array) $things as $thing )
1932       */
1933      $form_fields = array_merge_recursive( $form_fields, (array) $args['errors'] );
1934
1935      /** This filter is documented in wp-admin/includes/media.php */
1936      $form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
1937
1938      unset(
1939           $form_fields['image-size'],
1940           $form_fields['align'],
1941           $form_fields['image_alt'],
1942           $form_fields['post_title'],
1943           $form_fields['post_excerpt'],
1944           $form_fields['post_content'],
1945           $form_fields['url'],