[wp-trac] [WordPress Trac] #51006: Add a mechanism for accessible tooltips in core
WordPress Trac
noreply at wordpress.org
Tue Jan 23 00:38:58 UTC 2024
#51006: Add a mechanism for accessible tooltips in core
-------------------------------------+-------------------------------------
Reporter: joedolson | Owner: joedolson
Type: enhancement | Status: accepted
Priority: normal | Milestone: 6.5
Component: General | Version:
Severity: normal | Resolution:
Keywords: tooltips 2nd-opinion | Focuses: ui, accessibility,
has-patch | javascript
-------------------------------------+-------------------------------------
Comment (by rajinsharwar):
Updated changes: https://screenpal.com/watch/cZV0cIVJycu
Thanks for your feedback @joedolson, and I appreciate your suggestion. The
reason I thought of going over with a function is that we can use this
both in the frontend and backend. In #55343, a proposal was raised for
adding a Tooltip to "Remember Me" of the wp-login.php. So, if we choose to
go with only a JS approach, in that case, we might need to have it in
separate files and load those both in the admin panel and in the wp-
login.php. So, my opinion is to have a PHP function that can be called
from both the Frontend and Admin panel and also to enqueue those scripts
wherever there is a tooltip on the screen, not on all pages.
Still, if we choose to go with the JS way, and have those scripts and
styles only in the admin, I have submitted the (**PR
5928**)[https://github.com/WordPress/wordpress-develop/pull/5928] as well,
which includes this change :). It's now up to what we choose to go with.
Requesting suggestions on this, so maybe we can try to get this land
before Beta 1 in February.
Example Usage of the new PR:
{{{
<div class="tooltip-container" data-tooltip-text="<?php _e(
$tooltip_description ) ?>"></div>
}}}
{{{
<div class="tooltip-container" data-tooltip-text="<?php _e( 'This is
another Text for the Tooltip' ) ?>"></div>
}}}
Adding 2nd opinion for suggestions.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51006#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list