[wp-trac] [WordPress Trac] #25459: Provide more meaningful links in Edit Post/Page

WordPress Trac noreply at wordpress.org
Fri Nov 29 19:50:37 UTC 2013


#25459: Provide more meaningful links in Edit Post/Page
-------------------------------------+--------------------
 Reporter:  grahamarmfield           |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  low                      |   Milestone:  3.8
Component:  Accessibility            |     Version:  3.6.1
 Severity:  minor                    |  Resolution:
 Keywords:  needs-patch i18n-change  |
-------------------------------------+--------------------

Comment (by grahamarmfield):

 Suggest also that the function could include an optional argument to allow
 users to allocate appropriate class name for the portion for screen
 readers. This would allow more flexibility for the function to be used in
 custom themes on the front end where other class names may have been used
 to indicate screen reader only text. The default could be screen-reader-
 text.

 So how about this for a function?
 {{{
 function a11y_long_short( $longform, $shortform, $classname = 'screen-
 reader-text' ) {
    return '<span aria-hidden="true">' . $shortform . '</span><span
 class="' . $classname . '"> ' . $longform . '</span>';
 }
 }}}

 Note the addition of a leading space at the start of the long form text to
 help mitigate situations where AT doesn't recognise the aria-hidden
 attribute, or cases where the CSS is unavailable for some reason so the
 screen reader only text becomes visible. Without the leading space the
 last word of the shortform and the first word of the longform would be
 concatenated.

 I'm not sure in which file a function like that might be best placed to be
 available in front end too. /wp-includes/functions.php maybe?

 If some one could let me know I could prepare a patch with the function in
 and use the function to solve the original issues from the initial trac
 ticket.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25459#comment:34>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list