Inline documentation for image_attachment_fields_to_save(). props Moraleida.me. fixes #20803.

git-svn-id: http://core.svn.wordpress.org/trunk@21171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-06-28 20:31:28 +00:00
parent 168cc20a42
commit a90957aca0
1 changed files with 8 additions and 4 deletions

View File

@ -861,13 +861,17 @@ function media_post_single_attachment_fields_to_edit( $form_fields, $post ) {
}
/**
* {@internal Missing Short Description}}
* Filters input from media_upload_form_handler() and assigns a default
* post_title from the file name if none supplied.
*
* Illustrates the use of the attachment_fields_to_save filter
* which can be used to add default values to any field before saving to DB.
*
* @since 2.5.0
*
* @param unknown_type $post
* @param unknown_type $attachment
* @return unknown
* @param array $post
* @param array $attachment
* @return array
*/
function image_attachment_fields_to_save($post, $attachment) {
if ( substr($post['post_mime_type'], 0, 5) == 'image' ) {