Definition:
function image_attachment_fields_to_save($post, $attachment) {}
Parameters
- unknown_type $post
- unknown_type $attachment
Source code
function image_attachment_fields_to_save($post, $attachment) {
if ( substr($post['post_mime_type'], 0, 5) == 'image' ) {
if ( strlen(trim($post['post_title'])) == 0 ) {
$post['post_title'] = preg_replace('/\.\w+$/', '', basename($post['guid']));
$post['errors']['post_title']['errors'][] = __('Empty Title filled from filename.');
}
}
return $post;
}
1981

February 12, 2011 


No comments yet... Be the first to leave a reply!