Opened 8 years ago
Closed 8 years ago
#45472 closed defect (bug) (fixed)
Incorrect wp_get_script_polyfill() call in script loader
| Reported by: | swissspidy | Owned by: | desrosj |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.0.2 |
| Component: | Script Loader | Version: | 5.0 |
| Severity: | minor | Keywords: | has-patch fixed-5.0 |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 44208: