Update the wp_add_inline_script
function to provide a means for specifying an inline script as being standalone
#15
Labels
15
Estimate of 15 points
Script Loading Strategy
Issues relating to the Script Loading Strategy (WPP)
type:enhancement
New feature or request.
Milestone
Description
As part of enhancing the Scripts API with a loading strategy, there is a requirement to correctly handle inline scripts attached to main scripts so that their execution order is maintained. Inline scripts may, however, want to remain totally strategy agnostic and function in a standalone mode, having no inherent need to obey any parent/main script loading strategies. In order to provide this functionality, inline scripts should be able to specify/opt in to a standalone mode.
The existing
wp_add_inline_script
method, currently residing in WordPress core source at this location, should therefore be updated to cater for this new requirement. It should achieve this by way of introducing a new$standalone
parameter to the function. Thisboolean
parameter will be used to determine whether a user has opted for said inline script to be$standalone
or not.Acceptance Criteria
wp_add_inline_script
method, allowing the specification of aboolean
value against a new$standalone
parameter. This method currently resides in WordPress core source at this location.$standalone
parameter to said above function.$standalone
parameter is to be of typeboolean
$standalone
parameter is to have a default value offalse
Unit Tests
wp_add_inline_script
method currently reside in WordPress core source, starting at this location.$standalone
are of typeboolean
.$standalone
isfalse
.Designs
No response
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: