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
$p
WP_Interactivity_API_Directives_Processorrequired- The directives processor instance.
$mode
stringrequired- 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
Version | Description |
---|---|
6.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.