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.
Метод класса: WP_Interactivity_API{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WP_Interactivity_API = new WP_Interactivity_API(); $WP_Interactivity_API->add_client_navigation_support_to_script_module( $script_module_id );
- $script_module_id(строка) (обязательный)
- The script module identifier.
Список изменений
| С версии 6.9.0 | Введена. |
Код WP_Interactivity_API::add_client_navigation_support_to_script_module() WP Interactivity API::add client navigation support to script module WP 7.1.2
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;
}