Skip to content

Commit

Permalink
Do not load interactivity script modules in development mode when ful…
Browse files Browse the repository at this point in the history
…l page navigation is enabled
  • Loading branch information
michalczaplinski committed Aug 28, 2024
1 parent fb5fa24 commit 9aef408
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/interactivity-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ function gutenberg_reregister_interactivity_script_modules() {
wp_deregister_script_module( '@wordpress/interactivity' );
wp_deregister_script_module( '@wordpress/interactivity-router' );

$experiments = get_option( 'gutenberg-experiments' );

Check warning on line 17 in lib/interactivity-api.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Equals sign not aligned with surrounding assignments; expected 18 spaces but found 1 space
$full_page_navigation_enabled = isset( $experiments['gutenberg-full-page-client-side-navigation'] );

wp_register_script_module(
'@wordpress/interactivity',
gutenberg_url( '/build/interactivity/' . ( SCRIPT_DEBUG ? 'debug.min.js' : 'index.min.js' ) ),
array(),
$default_version
$full_page_navigation_enabled ? null : $default_version
);

wp_register_script_module(
'@wordpress/interactivity-router',
gutenberg_url( '/build/interactivity/router.min.js' ),
array( '@wordpress/interactivity' ),
$default_version
$full_page_navigation_enabled ? null : $default_version
);
}

Expand Down

0 comments on commit 9aef408

Please sign in to comment.