Warning: This function has been deprecated. Use WP_REST_Site_Health_Controller::test_loopback_requests() instead.

wp_ajax_health_check_loopback_requests() WordPress Function

This function is used to check if a user can make loopback requests. Loopback requests are used to run scheduled events, and to make sure that the site can communicate with itself.

wp_ajax_health_check_loopback_requests() #

Ajax handler for site health checks on loopback requests.


Description

Top ↑

See also


Top ↑

Source

File: wp-admin/includes/ajax-actions.php

function wp_ajax_health_check_loopback_requests() {
	_doing_it_wrong(
		'wp_ajax_health_check_loopback_requests',
		sprintf(
		// translators: 1: The Site Health action that is no longer used by core. 2: The new function that replaces it.
			__( 'The Site Health check for %1$s has been replaced with %2$s.' ),
			'wp_ajax_health_check_loopback_requests',
			'WP_REST_Site_Health_Controller::test_loopback_requests'
		),
		'5.6.0'
	);

	check_ajax_referer( 'health-check-site-status' );

	if ( ! current_user_can( 'view_site_health_checks' ) ) {
		wp_send_json_error();
	}

	if ( ! class_exists( 'WP_Site_Health' ) ) {
		require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
	}

	$site_health = WP_Site_Health::get_instance();
	wp_send_json_success( $site_health->get_test_loopback_requests() );
}


Top ↑

Changelog

Changelog
VersionDescription
5.6.0Use WP_REST_Site_Health_Controller::test_loopback_requests()
5.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More