Opened 6 years ago
Closed 6 years ago
#45472 closed defect (bug) (fixed)
Incorrect wp_get_script_polyfill() call in script loader
Reported by: | swissspidy | Owned by: | desrosj |
---|---|---|---|
Milestone: | 5.0.2 | Priority: | normal |
Severity: | minor | Version: | 5.0 |
Component: | Script Loader | Keywords: | has-patch fixed-5.0 |
Focuses: | Cc: |
Description
Script polyfills are currently loaded like this:
did_action( 'init' ) && $scripts->add_inline_script(
'wp-polyfill',
wp_get_script_polyfill(
$scripts,
array(
'\'fetch\' in window' => 'wp-polyfill-fetch',
'document.contains' => 'wp-polyfill-node-contains',
'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
),
'after'
)
);
This incorrectly passes 'after'
as the third parameter to wp_get_script_polyfill()
, which only accepts two parameters. It's clear that this argument is meant for add_inline_script()
instead.
However, since after
is the default argument for add_inline_script()
anyway, it can be safely omitted
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
In 44208: