[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentytwenty/classes/ -> class-twentytwenty-script-loader.php (summary)

JavaScript Loader Class Allow `async` and `defer` while enqueuing JavaScript.

File Size: 79 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

TwentyTwenty_Script_Loader:: (2 methods):
  migrate_legacy_strategy_script_data()
  filter_script_loader_tag()


Class: TwentyTwenty_Script_Loader  - X-Ref

A class that provides a way to add `async` or `defer` attributes to scripts.

migrate_legacy_strategy_script_data( $to_do )   X-Ref
Migrates legacy async/defer script data which might be used by child themes.

This method is used on the `print_scripts_array` filter.

param: string[] $to_do An array of script dependency handles.
return: string[] Unchanged array of script dependency handles.

filter_script_loader_tag( $tag, $handle )   X-Ref
Adds async/defer attributes to enqueued / registered scripts.

Now that #12009 has landed in WordPress 6.3, this method is only used for older versions of WordPress.
This method is used on the `script_loader_tag` filter.

param: string $tag    The script tag.
param: string $handle The script handle.
return: string Script HTML string.



Generated : Fri Nov 15 08:20:01 2024 Cross-referenced by PHPXref