From 110066a85aa5c9699ca610c4f54ad9758e33d147 Mon Sep 17 00:00:00 2001 From: weryques Date: Wed, 4 Apr 2018 09:52:31 -0300 Subject: [PATCH] Changes fields and filters order types --- src/api/class-tainacan-rest-controller.php | 1 + src/classes/repositories/class-tainacan-collections.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/class-tainacan-rest-controller.php b/src/api/class-tainacan-rest-controller.php index f3eb0adb1..bc732a2d4 100644 --- a/src/api/class-tainacan-rest-controller.php +++ b/src/api/class-tainacan-rest-controller.php @@ -244,6 +244,7 @@ class TAINACAN_REST_Controller extends WP_REST_Controller { * @param $args * * @return mixed + * @throws Exception */ private function prepare_meta($mapped, $request, $query, $mapped_v, $args){ $request_meta_query = $request[$mapped]; diff --git a/src/classes/repositories/class-tainacan-collections.php b/src/classes/repositories/class-tainacan-collections.php index 20c3c4535..df2b32165 100644 --- a/src/classes/repositories/class-tainacan-collections.php +++ b/src/classes/repositories/class-tainacan-collections.php @@ -138,14 +138,16 @@ class Collections extends Repository { 'fields_order' => [ 'map' => 'meta', 'title' => __( 'Ordination fields', 'tainacan' ), - 'type' => 'array', + 'type' => 'array/object/string', + 'items' => ['type' => 'array/string/integer/object'], 'description' => __( 'Collection fields ordination', 'tainacan' ), //'validation' => v::stringType(), ], 'filters_order' => [ 'map' => 'meta', 'title' => __( 'Ordination filters', 'tainacan' ), - 'type' => 'array', + 'type' => 'array/object/string', + 'items' => ['type' => 'array/string/integer/object'], 'description' => __( 'Collection filters ordination', 'tainacan' ), //'validation' => v::stringType(), ],