Skip to content

Commit

Permalink
Update lib/experimental/interactivity-api/script-loader.php
Browse files Browse the repository at this point in the history
Co-authored-by: Weston Ruter <westonruter@google.com>
  • Loading branch information
gziolo and westonruter committed May 5, 2023
1 parent e65b91e commit 9a31bb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/experimental/interactivity-api/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function gutenberg_register_interactivity_scripts( $scripts ) {
* @return string The modified script tag.
*/
function gutenberg_interactivity_scripts_add_defer_attribute( $tag, $handle ) {
if ( 0 === strpos( $handle, 'wp-interactivity-' ) ) {
if ( str_starts_with( $handle, 'wp-interactivity-' ) ) {
$p = new WP_HTML_Tag_Processor( $tag );
$p->next_tag( array( 'tag' => 'script' ) );
$p->set_attribute( 'defer', true );
Expand Down

0 comments on commit 9a31bb4

Please sign in to comment.