Scripts Handler
Last updated
Was this helpful?
Last updated
Was this helpful?
exposes the following public methods:
register_public_script
for adding a script to the internal frontend registration queue
deregister_public_script
for removing a script from the internal frontend registration queue
enqueue_public_script
for adding a script to the internal frontend enqueueing queue
dequeue_public_script
for removing a script from the internal frontend enqueueing queue
register_admin_script
for adding a script to the internal admin-side registration queue
deregister_admin_script
for removing a script from the internal admin-side registration queue
enqueue_admin_script
for adding a script to the internal admin-side enqueueing queue
dequeue_admin_script
for removing a script from the internal admin-side enqueueing queue
add_inline_script
for registering a JS string to be outputted before or after another enqueued file
localize_script
for including a JS object variable to be outputted before another enqueued file is
The methods follow almost 1-to-1 the WP scripts API, in particular the function, the function, the function, and the function.
As mentioned on the page, the handler will automatically attempt to register/enqueue the minified version of your script (if it exists in the same folder and has the .min.js
extension) and will attempt to set the file version to the result of the PHP filemtime
function.