You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Wordpress version >= 6.3.0, using am_modify_load_method results in the expected attribute not being added.
In this if statement, since I am always going to be using Wordpress version 6.3+, the defer string will never be added to $load_methods_to_async, so in turn will never be added to async_scripts, so in turn will never add the attribute to the tag.
Steps To Reproduce
On Wordpress 6.3 or greater, attempt to modify the load method for a script as documented.
Expected: The defer attribute is present on the script tag in the DOM Actual: The defer attribute is missing from the script tag
Additional Information
We tried using the async-defer load method as a workaround, but that prints an enqueue error stating "there is no guarantee it will be available for its dependent asset.”
Acceptance Criteria
Set the minimum required version of WordPress to 6.3.
Use the new script loading features available in 6.3 without condition checks.
Ensure there is a unit test that covers this use case and that it passes.
Description of the bug
With Wordpress version >=
6.3.0
, usingam_modify_load_method
results in the expected attribute not being added.In this if statement, since I am always going to be using Wordpress version 6.3+, the
defer
string will never be added to$load_methods_to_async
, so in turn will never be added to async_scripts, so in turn will never add the attribute to the tag.Steps To Reproduce
On Wordpress 6.3 or greater, attempt to modify the load method for a script as documented.
Expected: The
defer
attribute is present on the script tag in the DOMActual: The
defer
attribute is missing from the script tagAdditional Information
We tried using the
async-defer
load method as a workaround, but that prints an enqueue error stating "there is no guarantee it will be available for its dependent asset.”Acceptance Criteria
'async-defer'
load method #63 in a new v2.0.0 as a breaking change.The text was updated successfully, but these errors were encountered: