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

Line Code
663           $t['value'] = join(', ', $values);
664
665           $form_fields[$taxonomy] = $t;
666      }
667
668      // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
669      // The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing )
670      $form_fields = array_merge_recursive($form_fields, (array) $errors);
671
672      $form_fields = apply_filters('attachment_fields_to_edit', $form_fields, $post);
673
674      return $form_fields;
675 }
676
677 function get_media_items( $post_id, $errors ) {
678      if ( $post_id ) {
679           $post = get_post($post_id);
680           if ( $post && $post->post_type == 'attachment' )
681                $attachments = array($post->ID => $post);