1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
public function get_mystudy_zone() { global $json_api; $product = new WC_JSON_API_Products(); $entityBody = file_get_contents('php://input'); $dataObj = json_decode($entityBody); if ($dataObj === null && json_last_error() !== JSON_ERROR_NONE) { $json_api->error("Data is not valid"); }else{ if(!$dataObj->user_id){ $json_api->error("Data is not valid"); }else{ $products = $product->get_customer_downloads($dataObj->user_id); } } // print_r($products); return $products; } |