WP_Interactivity_API::add_client_navigation_support_to_script_module
Marks a script module as compatible with client-side navigation.
This method registers a script module to be loaded during client-side navigation in the Interactivity API router. Script modules marked with this method will have the loadOnClientNavigation option enabled in the data-wp-router-options directive.
Method of the class: WP_Interactivity_API{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WP_Interactivity_API = new WP_Interactivity_API(); $WP_Interactivity_API->add_client_navigation_support_to_script_module( $script_module_id );
- $script_module_id(string) (required)
- The script module identifier.
Changelog
| Since 6.9.0 | Introduced. |
WP_Interactivity_API::add_client_navigation_support_to_script_module() WP Interactivity API::add client navigation support to script module code WP 6.9.1
public function add_client_navigation_support_to_script_module( string $script_module_id ) {
$this->script_modules_that_can_load_on_client_navigation[ $script_module_id ] = true;
}