Make WordPress Core


Ignore:
Timestamp:
10/21/2025 11:30:43 AM (4 months ago)
Author:
luisherranz
Message:

Interactivity API: Support for loadOnClientNavigation.

Uses the wp_script_attributes filter to add a data-wp-router-options directive with a loadOnClientNavigation: true property for all the interactive blocks that are compatible with client-side navigation to let the Interactivity API router determine which modules it can safely load during client-side navigation.

Props luisherranz, westonruter.
Fixes #64122.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-modules.php

    r60999 r61019  
    203203        }
    204204
     205        // Marks all Core blocks as compatible with client-side navigation.
     206        if ( str_starts_with( $script_module_id, '@wordpress/block-library' ) ) {
     207            wp_interactivity()->add_client_navigation_support_to_script_module( $script_module_id );
     208        }
     209
    205210        $path = includes_url( "js/dist/script-modules/{$file_name}" );
    206211        wp_register_script_module( $script_module_id, $path, $script_module_data['dependencies'], $script_module_data['version'], $args );
Note: See TracChangeset for help on using the changeset viewer.