• 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.