[wp-trac] [WordPress Trac] #39004: Alt attributes should be searchable in media library
WordPress Trac
noreply at wordpress.org
Fri Jan 15 23:43:28 UTC 2021
#39004: Alt attributes should be searchable in media library
-------------------------------------+-------------------------------------
Reporter: joedolson | Owner: joedolson
Type: enhancement | Status: accepted
Priority: normal | Milestone: 5.7
Component: Media | Version: 3.0
Severity: normal | Resolution:
Keywords: needs-testing needs- | Focuses: accessibility,
unit-tests 2nd-opinion | administration
-------------------------------------+-------------------------------------
Changes (by joedolson):
* keywords: needs-testing needs-unit-tests => needs-testing needs-unit-
tests 2nd-opinion
Comment:
The frustrating thing about this ticket is that both the description and
caption fields are easily searched, because they're part of the post
table; but the alt attribute is not.
There are some hacky methods I can think of to handle this; e.g., do a
construction where the alt attribute field is appended to `post_content`
so that content is available for searches, then removed by output
functions. This would give a performant method of searching this value,
but feels a little dirty. That said, using the post_content as a data
store for searchability has some pseudo-precedent with how Gutenberg
structures data, so it's not totally out of line.
It would definitely work, but I feel a little dirty proposing it. Would
appreciate a second opinion on the idea.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39004#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list