From 3c245169052eb9eb754dd0601cca4120cf442f59 Mon Sep 17 00:00:00 2001 From: Eduardo humberto Date: Mon, 26 Feb 2018 10:40:17 -0300 Subject: [PATCH] create collection attribute for filters ordination --- .../entities/class-tainacan-collection.php | 21 ++++++++++++++++++- .../class-tainacan-collections.php | 7 +++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/classes/entities/class-tainacan-collection.php b/src/classes/entities/class-tainacan-collection.php index 6618972b5..f7d1d4503 100644 --- a/src/classes/entities/class-tainacan-collection.php +++ b/src/classes/entities/class-tainacan-collection.php @@ -254,7 +254,16 @@ class Collection extends Entity { function get_fields_order() { return $this->get_mapped_property('fields_order'); } - + + /** + * Get collection filters ordination + * + * @return string + */ + function get_filters_order() { + return $this->get_mapped_property('filters_order'); + } + /** * Get collection moderators ids * @@ -394,6 +403,16 @@ class Collection extends Entity { function set_fields_order($value) { $this->set_mapped_property('fields_order', $value); } + + /** + * Set collection filters ordination + * + * @param [string] $value + * @return void + */ + function set_filters_order($value) { + $this->set_mapped_property('filters_order', $value); + } /** * Set collection moderators ids diff --git a/src/classes/repositories/class-tainacan-collections.php b/src/classes/repositories/class-tainacan-collections.php index 0440c0fa0..5fa709c98 100644 --- a/src/classes/repositories/class-tainacan-collections.php +++ b/src/classes/repositories/class-tainacan-collections.php @@ -138,6 +138,13 @@ class Collections extends Repository { 'description'=> __('Collection fields ordination', 'tainacan'), //'validation' => v::stringType(), ], + 'filters_order' => [ + 'map' => 'meta', + 'title' => __('Ordination filters', 'tainacan'), + 'type' => 'string', + 'description'=> __('Collection filters ordination', 'tainacan'), + //'validation' => v::stringType(), + ], /* Isnt it just post status private?