On this page
wp_ajax_health_check_site_status_result()
Ajax handler for site health check to update the result status.
Source
File: wp-admin/includes/ajax-actions.php. View all references
function wp_ajax_health_check_site_status_result() {
check_ajax_referer( 'health-check-site-status-result' );
if ( ! current_user_can( 'view_site_health_checks' ) ) {
wp_send_json_error();
}
set_transient( 'health-check-site-status-result', wp_json_encode( $_POST['counts'] ) );
wp_send_json_success();
}
Related
Uses
| Uses | Description |
|---|---|
| set_transient() wp-includes/option.php | Sets/updates the value of a transient. |
| wp_json_encode() wp-includes/functions.php | Encodes a variable into JSON, with some sanity checks. |
| current_user_can() wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| check_ajax_referer() wp-includes/pluggable.php | Verifies the Ajax request to prevent processing requests external of the blog. |
| wp_send_json_error() wp-includes/functions.php | Sends a JSON response back to an Ajax request, indicating failure. |
| wp_send_json_success() wp-includes/functions.php | Sends a JSON response back to an Ajax request, indicating success. |
Changelog
| Version | Description |
|---|---|
| 5.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_ajax_health_check_site_status_result