[wp-trac] [WordPress Trac] #29022: Screen reader text isn't updated when plugin update count is updated

WordPress Trac noreply at wordpress.org
Sun Aug 3 01:12:48 UTC 2014


#29022: Screen reader text isn't updated when plugin update count is updated
-------------------------------------+-------------------------------------
 Reporter:  pento                    |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Upgrade/Install          |     Version:  3.9
 Severity:  normal                   |  Resolution:
 Keywords:  good-first-bug has-      |     Focuses:  accessibility,
  patch                              |  javascript, administration
-------------------------------------+-------------------------------------

Comment (by pento):

 The strings generated by `wp_get_update_data()` will be incorrect until
 all updates have finished - the data is cached, and isn't regenerated
 until the end of the update process.

 The iframe method is used, instead of an XHR-based system, because we're
 able to control the upgrade environment much more easily that way.

 You can see an example of sending translated strings to JS in `wp-admin
 /nav-menu.php`, search for `wp_localize_script`. The `menus` data object
 created by this call can be seen used in `wp-admin/js/nav-menu.js`, search
 for `menus.` to see instances of it. In this case, you'd create an array
 of the strings in PHP, and call it like so:

 `wp_localize_script( 'updates', 'updates', $update_strings );`

 You could then access the `updates` data object in the JS, to get the
 strings. These strings will only be loaded when `updates.js` is loaded.

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


More information about the wp-trac mailing list