diff --git a/wp-admin/includes/class-wp-site-health-auto-updates.php b/wp-admin/includes/class-wp-site-health-auto-updates.php index 1ddaa05feb..d1c133524d 100644 --- a/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -273,7 +273,7 @@ class WP_Site_Health_Auto_Updates { * @return array The test results. */ function test_check_wp_filesystem_method() { - // Make sure the `request_filesystem_credentials` function is available during our REST call. + // Make sure the `request_filesystem_credentials()` function is available during our REST API call. if ( ! function_exists( 'request_filesystem_credentials' ) ) { require_once ABSPATH . '/wp-admin/includes/file.php'; } @@ -324,7 +324,7 @@ class WP_Site_Health_Auto_Updates { return false; } - // Make sure the `get_core_checksums` function is available during our REST call. + // Make sure the `get_core_checksums()` function is available during our REST API call. if ( ! function_exists( 'get_core_checksums' ) ) { require_once ABSPATH . '/wp-admin/includes/update.php'; } diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 97cef303c1..98e0f4962c 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -2369,6 +2369,12 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false, echo ''; } } + + // Make sure the `submit_button()` function is available during the REST API call + // from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method(). + if ( ! function_exists( 'submit_button' ) ) { + require_once ABSPATH . '/wp-admin/includes/template.php'; + } ?>