What could be the problem when uploading image and how to fix it?

The problem is the following:
Create an account > click "Add media" > Upload a picture and get

in functions.php a filter cleaning title
add_filter( 'wp_insert_attachment_data', function( $data, $postarr )
 empty( $postarr['ID'] )
 && isset( $postarr['post_mime_type'] )
 && wp_match_mime_types( 'image', $postarr['post_mime_type'] )
 $data['post_title'] = ";

 return $data;
}, 10, 2 );

If the code is clean, that everything is fine. To the latest version of WP, this effect was not observed, what could be wrong and how to fix it?
April 3rd 20 at 18:38
0 answer

Find more questions by tags WordPress