WP_Interactivity_API::print_router_loading_and_screen_reader_markup()

In this article

Outputs the markup for the top loading indicator and the screen reader notifications during client-side navigations.

Description

This method prints a div element representing a loading bar visible during navigation, as well as an aria-live region that can be read by screen readers to announce navigation status.

Source

	public function print_router_loading_and_screen_reader_markup() {
		echo <<<HTML
			<div
				class="wp-interactivity-router-loading-bar"
				data-wp-interactive="core/router"
				data-wp-class--start-animation="state.navigation.hasStarted"
				data-wp-class--finish-animation="state.navigation.hasFinished"
			></div>
			<div
				class="screen-reader-text"
				aria-live="polite"
				data-wp-interactive="core/router"
				data-wp-text="state.navigation.message"
			></div>
HTML;
	}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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