Make WordPress Core

Changeset 50979


Ignore:
Timestamp:
05/24/2021 07:23:05 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Site Health: Make sure the submit_button() function is available in request_filesystem_credentials().

This avoids a fatal error when the function is called via REST API from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method().

Props lakrisgubben, mukesh27, Clorith, SergeyBiryukov.
Fixes #53206.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r50082 r50979  
    274274     */
    275275    function test_check_wp_filesystem_method() {
    276         // Make sure the `request_filesystem_credentials` function is available during our REST call.
     276        // Make sure the `request_filesystem_credentials()` function is available during our REST API call.
    277277        if ( ! function_exists( 'request_filesystem_credentials' ) ) {
    278278            require_once ABSPATH . '/wp-admin/includes/file.php';
     
    325325        }
    326326
    327         // Make sure the `get_core_checksums` function is available during our REST call.
     327        // Make sure the `get_core_checksums()` function is available during our REST API call.
    328328        if ( ! function_exists( 'get_core_checksums' ) ) {
    329329            require_once ABSPATH . '/wp-admin/includes/update.php';
  • trunk/src/wp-admin/includes/file.php

    r50701 r50979  
    23702370        }
    23712371    }
     2372
     2373    // Make sure the `submit_button()` function is available during the REST API call
     2374    // from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method().
     2375    if ( ! function_exists( 'submit_button' ) ) {
     2376        require_once ABSPATH . '/wp-admin/includes/template.php';
     2377    }
    23722378    ?>
    23732379    <p class="request-filesystem-credentials-action-buttons">
Note: See TracChangeset for help on using the changeset viewer.