


#Wp enqueue script vs wp denqueue scrpt code
Last but not least by having this on an action third party code (plugins, child themes) can unhook the callback to e.g.

'/js/custom-script.js' ) wpenqueuescript ( 'custom-script' ) Should simply be: wpenqueuescript ( 'custom-script', gettemplatedirectoryuri(). But also some plugin might create an endpoint that doesn't need JS/CSS. This: wpregisterscript ( 'custom-script', gettemplatedirectoryuri(). adminenqueuescripts is the proper hook to use when enqueuing scripts and styles that are meant to be used in the administration panel. You can use the adminenqueuescripts hook if you would like to enqueue a script into wp-admin. Within the action hook, you can use several functions and embed them in the functions.php file: wpregisterscript() wpenqueuescript() wpregisterstyle() wpenqueue. Let’s go through the basics of the wpenqueuescript hook that you’ll use to load your assets.
