Title: wp_register_script is not called correctly
Last modified: August 21, 2016

---

# wp_register_script is not called correctly

 *  Resolved [Nick Halsey](https://wordpress.org/support/users/celloexpressions/)
 * (@celloexpressions)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/wp_register_script-is-not-called-correctly/)
 * `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 init hooks. Please see Debugging in WordPress for more information. (This 
   message was added in version 3.3.) in [...]/wp-includes/functions.php on line
   3012`
 * The issue is in `cryptx.php:46`. You can’t just call wp_register_script raw, 
   it needs to be added to an action. [Looks like this was introduced in version 3.2.7](http://plugins.trac.wordpress.org/browser/cryptx/trunk/cryptx.php?annotate=blame#L46).
 * I would just do something like this:
    `add_action('wp_enqueue_scripts','cryptx_register_script');`,
   and move that code to that function.
 * Using `wp_enqueue_scripts` also prevents it from running that code in the admin.
 * [http://wordpress.org/plugins/cryptx/](http://wordpress.org/plugins/cryptx/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Ralf Weber](https://wordpress.org/support/users/d3395/)
 * (@d3395)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/wp_register_script-is-not-called-correctly/#post-3987892)
 * Fixed 😉
 *  Thread Starter [Nick Halsey](https://wordpress.org/support/users/celloexpressions/)
 * (@celloexpressions)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/wp_register_script-is-not-called-correctly/#post-3987893)
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp_register_script is not called correctly’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cryptx.svg)
 * [CryptX](https://wordpress.org/plugins/cryptx/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cryptx/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cryptx/)
 * [Active Topics](https://wordpress.org/support/plugin/cryptx/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cryptx/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cryptx/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Nick Halsey](https://wordpress.org/support/users/celloexpressions/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/wp_register_script-is-not-called-correctly/#post-3987893)
 * Status: resolved