PHP Notice: wp_enqueue_script was called inccorectly
-
You need to call
wp_enqueue_script()inside of the'wp_enqueue_script‘ action hook. Right now you’ll get this error if you haveWP_DEBUGon:PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the
wp_enqueue_scripts,admin_enqueue_scripts, orinithooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.)Example:
function comment_ca_va() { wp_enqueue_script( "CommentCaVa", plugins_url() . "/CommentCaVa/CommentCaVa.js" ); } add_action( 'wp_enqueue_script', 'comment_ca_va' );
The topic ‘PHP Notice: wp_enqueue_script was called inccorectly’ is closed to new replies.