WordPress.org

Make WordPress Core

Ticket #20803: media.php.patch

File media.php.patch, 808 bytes (added by Moraleida.me, 23 months ago)
  • media.php

     
    861861} 
    862862 
    863863/** 
    864  * {@internal Missing Short Description}} 
     864 * Filters input from media_upload_form_handler() and assigns a default 
     865 * post_title from the file name if none supplied.  
    865866 * 
     867 * Illustrates the use of the attachment_fields_to_save filter  
     868 * which can be used to add default values to any field before saving to DB. 
     869 * 
    866870 * @since 2.5.0 
    867871 * 
    868  * @param unknown_type $post 
    869  * @param unknown_type $attachment 
    870  * @return unknown 
     872 * @param array $post 
     873 * @param array $attachment 
     874 * @return array 
    871875 */ 
    872876function image_attachment_fields_to_save($post, $attachment) { 
    873877        if ( substr($post['post_mime_type'], 0, 5) == 'image' ) {