#58717 closed defect (bug) (worksforme)
async
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.3 |
Component: | Script Loader | Keywords: | close |
Focuses: | Cc: |
Description
i made
wp_enqueue_script( 'adsense', 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', array(), null, array('async', false)
but in the html i not see async attribute (i use wp 6.3 beta 3)
Change History (4)
#2
@
5 months ago
hi, new syntax is available with wp6.3 you can see in the https://core.trac.wordpress.org/browser/trunk/src/wp-includes/functions.wp-scripts.php#L170
but in beta 3 not work
#3
@
5 months ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
According to the documentation that you linked to, the newly modified parameter would have to be given as
array( 'strategy' => 'async', 'in_footer' => false )
(for example), and not as
array( 'async, false )
as in your example.
I'm therefore closing this ticket as worksforme
.
Note: See
TracTickets for help on using
tickets.
Thanks for your ticket. I do not believe
wp_enqueue_script
supports this syntax. The fifth attribute should be a simple boolean (true or false), and determines whether the script is loaded in the footer.It is possible however to add the
async
attribute using thescript_loader_tag
filter hook. See https://wordpress.stackexchange.com/a/198372 for an example.