[wp-trac] [WordPress Trac] #35021: Dashboard widgets doubled "Configure" link

WordPress Trac noreply at wordpress.org
Fri Dec 11 19:30:39 UTC 2015


#35021: Dashboard widgets doubled "Configure" link
-------------------------------+-----------------------------
 Reporter:  afercia            |      Owner:
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Widgets            |    Version:  4.4
 Severity:  normal             |   Keywords:  has-screenshots
  Focuses:  ui, accessibility  |
-------------------------------+-----------------------------
 Noticed while investigating on #34987: the Dashboard widgets with a
 "Configure" link have two "Configure" links. The first one is inside the
 toggle button and even if it's visually hidden, it's still focusable and
 can be activated using a keyboard. The second one is inside the heading.

 This is because the link HTML gets appended to the Widget name, see
 `wp_add_dashboard_widget()` and then the widget name is passed to
 `add_meta_box()` then in a global and finally used by `do_meta_boxes()`,
 both inside the toggle button and the heading. (phew!)

 To check this you'd need to install [https://wordpress.org/plugins/post-
 status-dashboard/ a Plugin that provides a configurable Dashboard widget].

 For now, in #34987 the first link gets hidden with CSS. A better solution
 would be avoiding to output useless markup in the first place.

 Ideally, the widget name should be just a string with no HTML and the link
 output should use a separate variable but then a new argument would be
 required. To keep it simple maybe the HTML part of the string could be
 removed just before the output with `explode()` or something like that. A
 bit weak though. Open to suggestions :)

 [[Image(https://cldup.com/XEyW3OHe7f.png)]]

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35021>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list