Make WordPress Core

Opened 13 months ago

Closed 13 months ago

Last modified 13 months ago

#58717 closed defect (bug) (worksforme)


Reported by: camaran's profile camaran Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3
Component: Script Loader Keywords: close
Focuses: Cc:


i made

wp_enqueue_script( 'adsense', '', array(), null, array('async', false)

but in the html i not see async attribute (i use wp 6.3 beta 3)

Change History (4)

#1 @roytanck
13 months ago

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 the script_loader_tag filter hook. See for an example.

#2 @camaran
13 months ago

hi, new syntax is available with wp6.3 you can see in the

but in beta 3 not work

Last edited 13 months ago by camaran (previous) (diff)

#3 @TobiasBg
13 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.

#4 @camaran
13 months ago

  • Keywords close added; needs-patch removed
Note: See TracTickets for help on using tickets.