Site Health: fix check name used for REST API permission checks.

Updates the calls to permission validation calls for the `directory-sizes` and `page-cache` routes to actually match the route names.

Follow-up to r54043 and r49154.

Props szepeviktor.
Fixes #59236
Built from https://develop.svn.wordpress.org/trunk@56489


git-svn-id: http://core.svn.wordpress.org/trunk@56001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2023-08-29 15:41:17 +00:00
parent e07e95e232
commit a4ee712d0d
2 changed files with 3 additions and 3 deletions

View File

@ -153,7 +153,7 @@ class WP_REST_Site_Health_Controller extends WP_REST_Controller {
'methods' => 'GET', 'methods' => 'GET',
'callback' => array( $this, 'get_directory_sizes' ), 'callback' => array( $this, 'get_directory_sizes' ),
'permission_callback' => function() { 'permission_callback' => function() {
return $this->validate_request_permission( 'debug_enabled' ) && ! is_multisite(); return $this->validate_request_permission( 'directory_sizes' ) && ! is_multisite();
}, },
) )
); );
@ -170,7 +170,7 @@ class WP_REST_Site_Health_Controller extends WP_REST_Controller {
'methods' => 'GET', 'methods' => 'GET',
'callback' => array( $this, 'test_page_cache' ), 'callback' => array( $this, 'test_page_cache' ),
'permission_callback' => function () { 'permission_callback' => function () {
return $this->validate_request_permission( 'view_site_health_checks' ); return $this->validate_request_permission( 'page_cache' );
}, },
), ),
) )

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56488'; $wp_version = '6.4-alpha-56489';
/** /**
* 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.