WP_Interactivity_API::data_wp_router_region_processor( WP_Interactivity_API_Directives_Processor $p, string $mode )

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Processes the data-wp-router-region directive.

Description

It renders in the footer a set of HTML elements to notify users about client-side navigations. More concretely, the elements added are 1) a top loading bar to visually inform that a navigation is in progress and 2) an aria-live region for accessible navigation announcements.

Parameters

$pWP_Interactivity_API_Directives_Processorrequired
The directives processor instance.
$modestringrequired
Whether the processing is entering or exiting the tag.

Source

				$p->add_class( $class_name );
			} else {
				$p->remove_class( $class_name );
			}
		}
	}
}

/**
 * Processes the `data-wp-style` directive.
 *
 * It updates the style attribute value of the current HTML element based on
 * the evaluation of its associated references.
 *
 * @since 6.5.0
 *
 * @param WP_Interactivity_API_Directives_Processor $p               The directives processor instance.
 * @param string                                    $mode            Whether the processing is entering or exiting the tag.
 */
private function data_wp_style_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) {
	if ( 'enter' === $mode ) {
		$all_style_attributes = $p->get_attribute_names_with_prefix( 'data-wp-style--' );

		foreach ( $all_style_attributes as $attribute_name ) {
			list( , $style_property ) = $this->extract_prefix_and_suffix( $attribute_name );
			if ( empty( $style_property ) ) {

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

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