[wp-hackers] proper action to hook into for styles and scripts
heiko.rabe at code-styling.de
Mon May 28 17:02:28 UTC 2012
Enqueue styles and scripts is he right way doing I also would prefere.
But the most common mistake made at attaching additional scripts and style
- polluting all admin pages with scripts only intended for frontend
- polluting all admin pages with admin intended script but only for few
plugin based pages
So you should also write conditional tests, wether you are producing a front
page output and skip enqueue of admin scripts. You should also test, if your
are at admin pages and avoid frontend enqueue.
Furthermore you should also separate by conditional tests, if your
plugin/theme page is about to be shown at backend and enqueue your admin
scripts only, if your page is about to be rendered!
Most incompatibilities of plugins are forced by polluting the entired admin
pages with scripts never intended for all admin pages.
Von: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] Im Auftrag von Bill
Gesendet: Montag, 28. Mai 2012 18:10
An: wp-hackers at lists.automattic.com
Betreff: Re: [wp-hackers] proper action to hook into for styles and scripts
Use wp_enqueue_scripts to enqueue both scripts and styles on the frontend.
Use admin_enqueue_scripts to enqueue both scripts and styles on the backend.
NOTE: To better serve my clients, partners, and most importantly my family,
I've begun checking email only three times per day.
For phone calls, please schedule here: http://tungle.me/billerickson . If
it's an emergency, please call now and leave a voicemail
On Mon, May 28, 2012 at 11:05 AM, Chris McCoy <chris at lod.com> wrote:
> Ive seen people use these
> and just
> and just
> which is the best way to go about it?
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
wp-hackers mailing list
wp-hackers at lists.automattic.com
More information about the wp-hackers