The tag has no wiki summary.

learn more… | top users | synonyms

27
votes
1answer
5k views

Where is the right place to register/enqueue scripts & styles

I am using WordPress 3.1.4 by now. I am confused with where (which hook) do I use: to register and/or enqueue scripts and styles on front- and back-ends? Questions: Which are right hooks to ...
5
votes
1answer
1k views

Load js/css files only on specific admin UI pages

How do I adapt this solution to work with my plugin? (Please see the link). I enqueue my css and js script as follows: function my_plugin_init() { wp_enqueue_script('my_plugin_script', ...
0
votes
3answers
523 views

wp_register_script was called incorrectly

I created this theme and it worked on my site without any problem. When I moved it to another server, I get wp_register_script was called incorrectly. error. I scanned my source code and I didn't use ...
5
votes
1answer
3k views

Register and enqueue conditional (browser-specific) javascript files?

The WP.SE community has always advised the use of wp_register_script and wp_enqueue_script for adding scripts in a theme/template (and likewise, wp_register_style and wp_enqueue_style for ...
3
votes
1answer
110 views

Hyphens vs. periods in the script slug in wp_register_script?

I have seen script and style handles written in two different ways in wp_register_script and wp_enqueue_script (the same applies to wp_register_style and wp_enqueue_style): wp_register_script( ...
16
votes
3answers
4k views

Check if a script/style was enqueued/registered

Is it possible to test whether a script or a style was registered using wp_register_script/_style or wp_enqueue_script/_style? All functions doesn't return a value and I'm completely clueless. I ...
7
votes
1answer
3k views

wp_enqueue_scripts, wp_register_scripts, wp_print_scripts: i'm confused

I've been reading up a bit on this subject, but the more I read - the more confused I get. Can someone explain to me in short what's the exact difference between wp_enqueue_scripts, ...
7
votes
2answers
1k views

Remove ?ver= from wp_register_script

I'm getting nags on google speed test regarding the querystrings in my scripts. So, I'm trying to remove them by passing false as the argument for that parameter. However, it does not seem to have ...
5
votes
1answer
3k views

When should I use wp_register_script() with wp_enqueue_script() vs just wp_enqueue_script()?

I'm having trouble understanding when you need to use wp_register_script(). Currently, I just use something like: add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) ); function enqueue() ...
0
votes
1answer
263 views

Register script/style: Is it possible to customize the version query string via plugin?

Expanding on the question in the title: I would like to find a way (via a plugin) to use timestamps for the JS and CSS file version query strings that are output with wp_register_style and ...
2
votes
2answers
153 views

Add a script as a dependency to a registered script

wp_register_script() (see codex) allows you to specify dependencies: scripts that must be loaded before the one being registered is loaded (if it is loaded). But suppose the script is a third-party ...
1
vote
1answer
232 views

After e-junkie payment, send a http post to register user automatically?

I have the workflow thought out: User pays for something on your site using e-junkie. After payment, a http post ( with user email and name gets sent to a wordpress registration script ) and ...
0
votes
1answer
104 views

Child Theme - what is the scope of overwriting files?

I noticed that creating twentythirteen-child/archive.php overwrites twentythirteen/archive.php but creating twentythirteen-child/shortcodes/drop-cap/drop-cap.php does not overwrite ...