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
254           if ( isset($attachment['post_content']) )
255                $post['post_content'] = $attachment['post_content'];
256           if ( isset($attachment['post_title']) )
257                $post['post_title'] = $attachment['post_title'];
258           if ( isset($attachment['post_excerpt']) )
259                $post['post_excerpt'] = $attachment['post_excerpt'];
260           if ( isset($attachment['menu_order']) )
261                $post['menu_order'] = $attachment['menu_order'];
262
263           $post = apply_filters('attachment_fields_to_save', $post, $attachment);
264
265           if ( isset($post['errors']) ) {
266                $errors[$attachment_id] = $post['errors'];
267                unset($post['errors']);
268           }
269
270           if ( $post != $_post )
271                wp_update_post($post);
272