[theme-reviewers] wp_enqueue_style

Justin Tadlock justin at justintadlock.com
Sat Jun 4 14:13:47 UTC 2011


You can also hook in too early if you need to use the is_*() conditional 
tags.

On 6/3/2011 8:09 AM, Mike Little wrote:
> 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/
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110604/eb10faa5/attachment-0001.htm>


More information about the theme-reviewers mailing list