[wp-trac] [WordPress Trac] #27175: Profile Color Schemes Don't Change
WordPress Trac
noreply at wordpress.org
Wed Mar 12 13:09:48 UTC 2014
#27175: Profile Color Schemes Don't Change
---------------------------+-----------------------------
Reporter: Ipstenu | Owner: nacin
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 3.9
Component: Script Loader | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses: administration
---------------------------+-----------------------------
Comment (by GregRoss):
I've been doing some poking at this since 3.9b1 hit yesterday as my plugin
uses custom color schemes. I found the issue is that the previous
recommendation for plugins was to use the 'admin_init' action to hook the
calls for wp_admin_css_color(), but 'admin_init' doesn't fire until after
script-loader.php runs so script-loader can't find the right css files and
drops back to the default color scheme.
Replacing 'admin_init' with just 'init' in my plugin "fixes" the problem,
but of course runs on EVERY page load, not just the admin page loads.
I haven't found another action yet that runs before the script-loader and
only on admin pages. Probably a few different possible solutions:
- create a new action for admin color schemes, something like
'admin_colors' (or find one that fits the requirement). Downside is that
all plugins that add color schemes have to be updated.
- move the loading of the admin color css files until after admin_init.
- revert back to the old code which blindly trusted that the css files
would be there when need :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27175#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list