WC_REST_Ping_V4_Controller::register_routespublicWC 4.0.0

Register the routes for ping.

Method of the class: WC_REST_Ping_V4_Controller{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_REST_Ping_V4_Controller = new WC_REST_Ping_V4_Controller();
$WC_REST_Ping_V4_Controller->register_routes();

Changelog

Since 4.0.0 Introduced.

WC_REST_Ping_V4_Controller::register_routes() code WC 10.3.6

public function register_routes() {
	register_rest_route(
		$this->namespace,
		'/' . $this->rest_base,
		array(
			array(
				'methods'             => WP_REST_Server::READABLE,
				'callback'            => array( $this, 'get_ping' ),
				'permission_callback' => array( $this, 'get_ping_permissions_check' ),
			),
			'schema' => array( $this, 'get_public_item_schema' ),
		)
	);
}