Title: Bug: wrong parameter to wp_register_scripts
Last modified: October 11, 2022

---

# Bug: wrong parameter to wp_register_scripts

 *  [jondaley](https://wordpress.org/support/users/jondaley/)
 * (@jondaley)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/bug-wrong-parameter-to-wp_register_scripts/)
 * includes/class-scripts.php:
 * lines 702 and 713 need a boolean flipped to wp_register_scripts().
 * The src is currently set to true, which maybe was valid for a previous version
   of WordPress, I don’t know, but the current value should be set to false, as 
   we aren’t really registering a script with a valid src tag, but inline scripts.
 * Setting the second parameter of wp_register_script to false, fixes the bug.
 * What the actual problem is that the preload code loops through all scripts registered
   by wp_register_script, and adds
 * <link rel=”preload” href=”1″ as=”script”>
 * which causes a 404 per page load, which generates the whole wordpress pipeline.
   And worse, on a page like the admin widgets, particularly with legacy widgets,
   causes a 404 per block (triggering a firewall rule in my case, which is how I
   noticed the bug).

The topic ‘Bug: wrong parameter to wp_register_scripts’ is closed to new replies.

 * ![](https://ps.w.org/cc-scripts/assets/icon-256x256.png?rev=1482422)
 * [CC-Scripts](https://wordpress.org/plugins/cc-scripts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cc-scripts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cc-scripts/)
 * [Active Topics](https://wordpress.org/support/plugin/cc-scripts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cc-scripts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cc-scripts/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [jondaley](https://wordpress.org/support/users/jondaley/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/bug-wrong-parameter-to-wp_register_scripts/)
 * Status: not resolved