Revert [59097] because it was renaming a public method that should be deprecated instead.
Built from https://develop.svn.wordpress.org/trunk@59098 git-svn-id: http://core.svn.wordpress.org/trunk@58494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8786fe5da6
commit
d5c6e455e8
|
@ -199,26 +199,6 @@ final class WP_Interactivity_API {
|
||||||
_deprecated_function( __METHOD__, '6.7.0' );
|
_deprecated_function( __METHOD__, '6.7.0' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set client-side interactivity-router data.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* @since 6.7.0
|
|
||||||
*
|
|
||||||
* @param array $data Data to filter.
|
|
||||||
* @return array Data for the Interactivity Router script module.
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set client-side interactivity data.
|
* Set client-side interactivity data.
|
||||||
*
|
*
|
||||||
|
@ -316,7 +296,6 @@ final class WP_Interactivity_API {
|
||||||
*/
|
*/
|
||||||
public function add_hooks() {
|
public function add_hooks() {
|
||||||
add_filter( 'script_module_data_@wordpress/interactivity', array( $this, 'filter_script_module_interactivity_data' ) );
|
add_filter( 'script_module_data_@wordpress/interactivity', array( $this, 'filter_script_module_interactivity_data' ) );
|
||||||
add_filter( 'script_module_data_@wordpress/interactivity-router', array( $this, 'filter_script_module_interactivity_router_data' ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -994,14 +973,16 @@ CSS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Outputs markup for the @wordpress/interactivity-router script module.
|
* Outputs the markup for the top loading indicator and the screen reader
|
||||||
|
* notifications during client-side navigations.
|
||||||
*
|
*
|
||||||
* This method prints a div element representing a loading bar visible during
|
* This method prints a div element representing a loading bar visible during
|
||||||
* navigation.
|
* navigation, as well as an aria-live region that can be read by screen
|
||||||
|
* readers to announce navigation status.
|
||||||
*
|
*
|
||||||
* @since 6.7.0
|
* @since 6.5.0
|
||||||
*/
|
*/
|
||||||
public function print_router_markup() {
|
public function print_router_loading_and_screen_reader_markup() {
|
||||||
echo <<<HTML
|
echo <<<HTML
|
||||||
<div
|
<div
|
||||||
class="wp-interactivity-router-loading-bar"
|
class="wp-interactivity-router-loading-bar"
|
||||||
|
@ -1009,6 +990,12 @@ CSS;
|
||||||
data-wp-class--start-animation="state.navigation.hasStarted"
|
data-wp-class--start-animation="state.navigation.hasStarted"
|
||||||
data-wp-class--finish-animation="state.navigation.hasFinished"
|
data-wp-class--finish-animation="state.navigation.hasFinished"
|
||||||
></div>
|
></div>
|
||||||
|
<div
|
||||||
|
class="screen-reader-text"
|
||||||
|
aria-live="polite"
|
||||||
|
data-wp-interactive="core/router"
|
||||||
|
data-wp-text="state.navigation.message"
|
||||||
|
></div>
|
||||||
HTML;
|
HTML;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,16 +1016,16 @@ HTML;
|
||||||
if ( 'enter' === $mode && ! $this->has_processed_router_region ) {
|
if ( 'enter' === $mode && ! $this->has_processed_router_region ) {
|
||||||
$this->has_processed_router_region = true;
|
$this->has_processed_router_region = true;
|
||||||
|
|
||||||
/*
|
// Initialize the `core/router` store.
|
||||||
* Initialize the `core/router` store.
|
|
||||||
* If the store is not initialized like this with minimal
|
|
||||||
* navigation object, the interactivity-router script module
|
|
||||||
* errors.
|
|
||||||
*/
|
|
||||||
$this->state(
|
$this->state(
|
||||||
'core/router',
|
'core/router',
|
||||||
array(
|
array(
|
||||||
'navigation' => new stdClass(),
|
'navigation' => array(
|
||||||
|
'texts' => array(
|
||||||
|
'loading' => __( 'Loading page, please wait.' ),
|
||||||
|
'loaded' => __( 'Page Loaded.' ),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1048,7 +1035,7 @@ HTML;
|
||||||
wp_enqueue_style( 'wp-interactivity-router-animations' );
|
wp_enqueue_style( 'wp-interactivity-router-animations' );
|
||||||
|
|
||||||
// Adds the necessary markup to the footer.
|
// Adds the necessary markup to the footer.
|
||||||
add_action( 'wp_footer', array( $this, 'print_router_markup' ) );
|
add_action( 'wp_footer', array( $this, 'print_router_loading_and_screen_reader_markup' ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.7-alpha-59097';
|
$wp_version = '6.7-alpha-59098';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue