[wp-trac] [WordPress Trac] #37989: Unexpected change to media title behavior in WP 4.6.1

WordPress Trac noreply at wordpress.org
Tue Sep 13 22:43:01 UTC 2016


#37989: Unexpected change to media title behavior in WP 4.6.1
---------------------------+------------------------
 Reporter:  arhenderson63  |       Owner:  joemcgill
     Type:  defect (bug)   |      Status:  accepted
 Priority:  normal         |   Milestone:  4.6.2
Component:  Media          |     Version:  4.6.1
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:
---------------------------+------------------------

Comment (by richdixon):

 Replying to [comment:11 SergeyBiryukov]:
 > A workaround:
 > {{{
 > function wp37989_fix_encoded_attachment_titles( $data, $postarr ) {
 >       $basename = pathinfo( $postarr['file'], PATHINFO_BASENAME );
 >
 >       $data['post_title'] = sanitize_text_field( $basename );
 >
 >       return $data;
 > }
 > add_filter( 'wp_insert_attachment_data',
 'wp37989_fix_encoded_attachment_titles', 10, 2 );
 > }}}

 Can you help me with using this workaround? Do I just paste the code in my
 child theme's functions.php code? I tried that and it didn't seem to work.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37989#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list