Skip to content

Commit

Permalink
Rename method to reflect its new behavior
Browse files Browse the repository at this point in the history
The print_router_loading_and_screen_reader_markup method name was very
specific about its behavior which has changed. Rename the method to a
more descriptive name and update its documentation.
  • Loading branch information
sirreal committed Sep 26, 2024
1 parent f2ba5de commit e7c6cfe
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/wp-includes/interactivity-api/class-wp-interactivity-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,16 +994,14 @@ private function get_router_animation_styles(): string {
}

/**
* Outputs the markup for the top loading indicator and the screen reader
* notifications during client-side navigations.
* Outputs markup for the @wordpress/interactivity-router script module.
*
* 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.
* navigation.
*
* @since 6.5.0
* @since 6.7.0
*/
public function print_router_loading_and_screen_reader_markup() {
public function print_router_markup() {
echo <<<HTML
<div
class="wp-interactivity-router-loading-bar"
Expand Down Expand Up @@ -1050,7 +1048,7 @@ private function data_wp_router_region_processor( WP_Interactivity_API_Directive
wp_enqueue_style( 'wp-interactivity-router-animations' );

// Adds the necessary markup to the footer.
add_action( 'wp_footer', array( $this, 'print_router_loading_and_screen_reader_markup' ) );
add_action( 'wp_footer', array( $this, 'print_router_markup' ) );
}
}

Expand Down

0 comments on commit e7c6cfe

Please sign in to comment.