[wp-trac] [WordPress Trac] #21221: Image title and alt attribute content should be texturized.

WordPress Trac noreply at wordpress.org
Tue Jul 22 23:36:58 UTC 2025


#21221: Image title and alt attribute content should be texturized.
------------------------------------------+----------------------
 Reporter:  stephdau                      |       Owner:  (none)
     Type:  enhancement                   |      Status:  closed
 Priority:  normal                        |   Milestone:
Component:  Media                         |     Version:  3.4.1
 Severity:  normal                        |  Resolution:  wontfix
 Keywords:  dev-feedback has-patch close  |     Focuses:
------------------------------------------+----------------------
Changes (by sabernhardt):

 * status:  new => closed
 * resolution:   => wontfix


Comment:

 I also agree to close.

 Jetpack's Gallery Carousel uses `data-` attributes and added
 `wptexturize()` for
 [https://github.com/Automattic/jetpack/blob/1e9cef5af36c1d4b7169c2e54d5dfb50b4aa5667/projects/plugins/jetpack/modules/carousel
 /jetpack-carousel.php#L968-L970 title, description and caption].

 If appropriate, individual sites or plugins similarly could use the
 `wp_get_attachment_image_attributes` hook to run the function on
 attributes in [gallery] shortcode images.
 {{{
 add_filter( 'wp_get_attachment_image_attributes',
 'use_wptexturize_for_alt_attr' );
 function use_wptexturize_for_alt_attr( $attr ) {
         $attr['alt'] = wptexturize( $attr['alt'] );

         return $attr;
 }
 }}}

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


More information about the wp-trac mailing list