Make WordPress Core

Changeset 56489 for trunk


Ignore:
Timestamp:
08/29/2023 03:39:13 PM (3 years ago)
Author:
swissspidy
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-site-health-controller.php

    r54797 r56489  
    154154                                'callback'            => array( $this, 'get_directory_sizes' ),
    155155                                'permission_callback' => function() {
    156                                         return $this->validate_request_permission( 'debug_enabled' ) && ! is_multisite();
     156                                        return $this->validate_request_permission( 'directory_sizes' ) && ! is_multisite();
    157157                                },
    158158                        )
     
    171171                                        'callback'            => array( $this, 'test_page_cache' ),
    172172                                        'permission_callback' => function () {
    173                                                 return $this->validate_request_permission( 'view_site_health_checks' );
     173                                                return $this->validate_request_permission( 'page_cache' );
    174174                                        },
    175175                                ),
Note: See TracChangeset for help on using the changeset viewer.