[wp-trac] [WordPress Trac] #51006: Add a mechanism for accessible tooltips in core

WordPress Trac noreply at wordpress.org
Thu Nov 16 00:58:07 UTC 2023


#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 has-     |     Focuses:  ui, accessibility, javascript
  patch                       |
------------------------------+--------------------------------------------

Comment (by rajinsharwar):

 Hi all, I tried to start the work on this feature to get things started. I
 know the code isn't perfect or not that good, but I hope this will provide
 a good benchmark for getting things rolling for this feature.

 Demo: https://prnt.sc/zkAl_zz_XwPo

 Introduced a new function: add_tooltip()

 It accepts a total of 3 parameters:
 * The 1st is a UNIQUE field ID, which will be used as the div ID of the
 tooltip container.
 * The 2nd is the tooltip-text which will be shown to the users upon click
 or click of Enter (For keyboard users)
 * The 3rd is an OPTIONAL parameter, which will be used as the Label for
 the Tooltip. If nothing passed, the default goes as "Help".

 Example Usage:
 {{{#!php
 add_tooltip('tooltip-1', $tagline_description);
 add_tooltip('tooltip-2', 'This is a Text for the Tooltip');
 }}}

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


More information about the wp-trac mailing list