From: Laury GvR Date: Thu, 1 Aug 2019 16:02:13 +0000 (-0400) Subject: get pointsOfInterest route params into usable vars, include request X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=6fd4c083a3602ed4a8b4ca534d7ee2735125a777;p=WP-Plugins%2Fglm-member-db-rest-api.git get pointsOfInterest route params into usable vars, include request --- diff --git a/setup/routes/pointsOfInterest.php b/setup/routes/pointsOfInterest.php index 53a7d1b..1beaa03 100644 --- a/setup/routes/pointsOfInterest.php +++ b/setup/routes/pointsOfInterest.php @@ -59,6 +59,18 @@ class GLMA_POI_Rest_Controller array( // endpoint for getting members 'methods' => WP_REST_Server::READABLE, 'callback' => function( $request ) { + + + $latMin = $this->params['latMin']; + $lastLatMin = $this->params['lastLatMin']; + $latMax = $this->params['latMax']; + $lastLatMax = $this->params['lastLatMax']; + $lonMin = $this->params['lonMin']; + $lastLonMin = $this->params['lastLonMin']; + $lonMax = $this->params['lonMax']; + $lastLonMax = $this->params['lastLonMax']; + + // Callback function can be a lot shorter. // You could just create a new model to get the results in an array // and use return rest_ensure_response( $data );