[wp-trac] [WordPress Trac] #30488: Switching between Admin Color Schemes does not immediately update the body class.

WordPress Trac noreply at wordpress.org
Mon Nov 24 22:33:44 UTC 2014


#30488: Switching between Admin Color Schemes does not immediately update the body
class.
--------------------------------------------+-----------------------------
 Reporter:  valendesigns                    |      Owner:
     Type:  defect (bug)                    |     Status:  new
 Priority:  normal                          |  Milestone:  Awaiting Review
Component:  Administration                  |    Version:  trunk
 Severity:  normal                          |   Keywords:
  Focuses:  ui, javascript, administration  |
--------------------------------------------+-----------------------------
 Recently I was working on a plugin that required different menu icons
 based on the color scheme currently activated. However, I found that when
 you switch between schemes in your profile the `body` class is not updated
 until you manually refresh the page. Which means any styles you've added
 via `admin_head` to change your icon globally are not immediately
 reflected in the UI.

 I'm submitting this ticket with a simple patch. The changes I've made are
 to pass the value of `$color_scheme` to the `wp_send_json_success()`
 function via its `$data` parameter, and a bit of JavaScript that removes
 the old color scheme and adds the newly selected one to the `body` class.

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


More information about the wp-trac mailing list