Title: wp_enqueue_script called too early
Last modified: August 22, 2016

---

# wp_enqueue_script called too early

 *  Resolved [daymobrew](https://wordpress.org/support/users/daymobrew/)
 * (@daymobrew)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/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 3370`
 * I 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)
 * [http://pastebin.com/wzgWVzDM](http://pastebin.com/wzgWVzDM)
 * [https://wordpress.org/plugins/woocommerce-checkout-manager/](https://wordpress.org/plugins/woocommerce-checkout-manager/)

Viewing 1 replies (of 1 total)

 *  [emark](https://wordpress.org/support/users/emark/)
 * (@emark)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/wp_enqueue_script-called-too-early/#post-5464493)
 * Added in version 3.6.6

Viewing 1 replies (of 1 total)

The topic ‘wp_enqueue_script called too early’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-checkout-manager/assets/icon-256x256.jpg?rev
   =2911736)
 * [Checkout Field Manager (Checkout Manager) for WooCommerce](https://wordpress.org/plugins/woocommerce-checkout-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-checkout-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-checkout-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-checkout-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-checkout-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-checkout-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [emark](https://wordpress.org/support/users/emark/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/wp_enqueue_script-called-too-early/#post-5464493)
 * Status: resolved