Make WordPress Core

Opened 4 months ago

Closed 3 months ago

#26549 closed defect (bug) (wontfix)

Remove title attributes: media.php

Reported by: joedolson Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch 2nd-opinion close
Focuses: accessibility Cc:

Description (last modified by SergeyBiryukov)

Related: #24766

// media.php

Attachments (1)

26549.patch (1.0 KB) - added by joedolson 4 months ago.
Remove title attribute patch for wp-includes/media.php

Download all attachments as: .zip

Change History (8)

comment:1 SergeyBiryukov4 months ago

  • Description modified (diff)

joedolson4 months ago

Remove title attribute patch for wp-includes/media.php

comment:2 joedolson4 months ago

The only call to get_image_tag is in get_image_send_to_editor, which submits a blank string for the title attribute. Therefore, in get_image_tag, $title will never receive a value.

A title can still be added via the image_send_to_editor filter, but get_image_tag will still be irrelevant. Therefore, unless I'm missing something, it's totally reasonable to remove all references to $title in get_image_tag, adding documentation to the effect that it's been deprecated.

This is a simple patch, but it may be feasible to remove the attribute from the function arguments, as long as $title is declared and passed to the filter.

comment:3 joedolson4 months ago

  • Keywords has-patch added

comment:4 joedolson4 months ago

  • Keywords 2nd-opinion added

comment:5 nacin3 months ago

  • Component changed from Accessibility to Media
  • Focuses accessibility added
  • Keywords close added

get_image_tag() almost had $title removed during the great Media Image Title Massacre of 3.5 (#18984). However, I realized it could easily be construed to be a utility function and that others may be using it with a tooltip. I think it's best to leave this one alone.

comment:6 joedolson3 months ago

Given that it is only likely to be used if somebody has specifically gone out of their way to implement it, it's probably fine to leave alone, as you say. Cheerio.

comment:7 nacin3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.