[theme-reviewers] wp_enqueue_style

Mike Little wordpress at zed1.com
Fri Jun 3 13:09:18 UTC 2011


Just to throw an edge case spanner in the works, I think you *can* enqueue
too early.

I had a problem on a project a few weeks ago that was using domain mapping
on a temporary domain to build a site before the real domain was pointed at
the newserver. What we discovered was that *some* scripts and *some* styles
were being output with the wrong domain, both front end and admin screens,
but that others were mapped correctly.

It turns out that WP caches the full url to the enqueued scripts/styles, and
thus if they are enqueued too early (before the mapping plugin can hook
site_url() etc), they will be output with the wrong domain.

It *is* an edge case, but in this case it broke the site. The fix, by the
way, IIRC was to make the domain mapper search and replace in the enqueued
caches after hooking print_scripts/styles! Nasty!


Mike
-- 
Mike Little
http://zed1.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110603/87b658b1/attachment.htm>


More information about the theme-reviewers mailing list