Make WordPress Core

Opened 22 months ago

Last modified 22 months ago

#21221 new enhancement

Image title and alt attribute content should be texturized.

Reported by: stephdau Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.4.1
Component: Media Keywords: has-patch
Focuses: Cc:


gallery_shortcode() texturizes the caption shown underneath images in galleries.

For consistency, alt and title tags content should also be texturized.
This is also valuable for developers extending the gallery shortcode or output, such as with the WordPress.com (and Jetpack) Gallery Carousel feature, as it provides i18n'd texturization, for EG.

See attached patch, which:

  • uses wptexturize() in wp_get_attachment_image() directly (/wp-includes/media.php), which makes it work with gallries, attachment pages, etc.
  • also uses wptexturize() in get_image_tag() (/wp-includes/media.php), for consistency.
  • uses wptexturize() in wp_get_attachment_link() (/wp-includespost-template.php), for consistency

Attachments (1)

21221.diff (2.3 KB) - added by stephdau 22 months ago.

Download all attachments as: .zip

Change History (2)

stephdau22 months ago

comment:1 toscho22 months ago

  • Cc info@… added

Do not hard code the function, use a apply_filters() instead. See #19550.

Note: See TracTickets for help on using tickets.