wp_register_script error
-
I suggest the following adjustment to the inc/initLight.inc.php module
if($GLOBALS[“canvasioId”]==0){
add_action( ‘wp_enqueue_scripts’, ‘caCustom_scripts’);
}
/*******************
* jvs – modified this module to correct error message:Notice: wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts,
admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information.
(This message was added in version 3.3.0.) in /www/wepacuxe_957/public/wp-includes/functions.php on line 4773
*********************************/function caCustom_scripts ( ) {
wp_register_script(‘threejs’,plugins_url(‘/inc/js/three.min.js’,dirname(__FILE__),false));
wp_register_script(‘glDetector’,plugins_url(‘/inc/js/Detector.js’,dirname(__FILE__),false));
wp_register_script(‘wpWebGL’,plugins_url(‘/inc/js/wpWebGL.js’,dirname(__FILE__),false));
}This should replace the direct use of wp_register_script at time of init with registration at a more appropriate point in the execution stream.
- The topic ‘wp_register_script error’ is closed to new replies.