wp_enqueue_script called too early
-
I have WP_DEBUG enabled and see the following warning from WordPress:
Notice: wp_enqueue_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.) in /usr/local/pem/vhosts/296563/webspace/httpdocs/damienstaging.com/wp-includes/functions.php on line 3370I believe that it refers to the code:
wp_enqueue_script('jquery-ui-datepicker'); wp_enqueue_style( 'jquery-ui-style', (is_ssl()) ? 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' : 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );Those calls should be in a wp_enqueue_script action.
5 months ago you said that these will be fixed in a new version but 3.6.5 was released since then.Here is my patch (I am sure it is very like what you plan to do)
The topic ‘wp_enqueue_script called too early’ is closed to new replies.