Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: attachment_fields_to_save

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
418
419                     // update_post_meta() expects slashed.
420                     update_post_meta( $post_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
421                }
422           }
423
424           $attachment_data = isset( $post_data['attachments'][ $post_id ] ) ? $post_data['attachments'][ $post_id ] : array();
425
426           /** This filter is documented in wp-admin/includes/media.php */
427           $translated = apply_filters( 'attachment_fields_to_save', $translated, $attachment_data );
428      }
429
430      // Convert taxonomy input to term IDs, to avoid ambiguity.
431      if ( isset( $post_data['tax_input'] ) ) {
432           foreach ( (array) $post_data['tax_input'] as $taxonomy => $terms ) {
433                $tax_object = get_taxonomy( $taxonomy );
434
435                if ( $tax_object && isset( $tax_object->meta_box_sanitize_cb ) ) {
436                     $translated['tax_input'][ $taxonomy ] = call_user_func_array( $tax_object->meta_box_sanitize_cb, array( $taxonomy, $terms ) );