WP_Interactivity_API::filter_script_module_interactivity_router_data( array $data ): array

Set client-side interactivity-router data.

Description

Once in the browser, the state will be parsed and used to hydrate the client-side interactivity stores and the configuration will be available using a getConfig utility.

Parameters

$dataarrayrequired
Data to filter.

Return

array Data for the Interactivity Router script module.

Source

public function filter_script_module_interactivity_router_data( array $data ): array {
	if ( ! isset( $data['i18n'] ) ) {
		$data['i18n'] = array();
	}
	$data['i18n']['loading'] = __( 'Loading page, please wait.' );
	$data['i18n']['loaded']  = __( 'Page Loaded.' );
	return $data;
}

Changelog

VersionDescription
6.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.