PingController.php (592B)
1 <?php 2 /** 3 * Controls Http requests 4 */ 5 6 namespace Extendify\ExtendifySdk\Controllers; 7 8 use Extendify\ExtendifySdk\Http; 9 10 if (!defined('ABSPATH')) { 11 die('No direct access.'); 12 } 13 14 /** 15 * The controller for sending little bits of info 16 */ 17 class PingController 18 { 19 /** 20 * Send data about a specific topic 21 * 22 * @param \WP_REST_Request $request - The request. 23 * @return WP_REST_Response|WP_Error 24 */ 25 public static function ping($request) 26 { 27 $response = Http::post('/ping', $request->get_params()); 28 return new \WP_REST_Response($response); 29 } 30 }