Skip to content

Commit 5ed2912

Browse files
committed
Try to fix unit test
1 parent 18ac430 commit 5ed2912

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

includes/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262
// Initialize REST API routes when WordPress is available.
6363
if ( function_exists( 'add_action' ) ) {
64-
add_action( 'rest_api_init', array( 'WP_REST_Abilities_Init', 'register_routes' ) );
64+
add_action( 'rest_api_init', array( 'WP_REST_Abilities_Init', 'register_routes' ), 11 );
6565
}
6666
}
6767

includes/rest-api/class-wp-rest-abilities-init.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ class WP_REST_Abilities_Init {
2020
* Registers the REST API routes for abilities.
2121
*
2222
* @since 0.1.0
23+
*
24+
* @param WP_REST_Server|null $rest_server Optional. The REST server to register routes with. Default null, which
25+
* will use the main REST server instance.
2326
*/
24-
public static function register_routes( $rest_server ): void {
27+
public static function register_routes( $rest_server = null ): void {
2528
if ( ! $rest_server instanceof WP_REST_Server ) {
2629
$rest_server = rest_get_server();
2730
}

0 commit comments

Comments
 (0)