From 8d61c27a9da09490e56863029a305086d061968e Mon Sep 17 00:00:00 2001 From: mithu Date: Thu, 2 Nov 2017 01:04:53 +0600 Subject: [PATCH 1/2] include, exclude, number and parent options added for multicheck-categories field type. include - to list specific categories/taxonmies, exclude - to exclude specific categories/taxonmies, number - Maximum number of terms to return, parent - to get all terms of a specific parent category/taxonmy --- .gitignore | 3 ++- lib/class-option-multicheck-categories.php | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 35efc921..299a2145 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ npm-debug.log /node_modules coverage coverage.clover -/dist \ No newline at end of file +/dist +.idea/ diff --git a/lib/class-option-multicheck-categories.php b/lib/class-option-multicheck-categories.php index 00d835a0..63446b8d 100644 --- a/lib/class-option-multicheck-categories.php +++ b/lib/class-option-multicheck-categories.php @@ -11,7 +11,11 @@ class TitanFrameworkOptionMulticheckCategories extends TitanFrameworkOptionMulti 'taxonomy' => 'category', 'hide_empty' => false, 'show_count' => false, - 'select_all' => false + 'select_all' => false, + 'include' => false, + 'exclude' => false, + 'number' => 0, + 'parent' => '', ); /* @@ -23,6 +27,10 @@ public function display() { 'order' => $this->settings['order'], 'taxonomy' => $this->settings['taxonomy'], 'hide_empty' => $this->settings['hide_empty'] ? '1' : '0', + 'include' => $this->settings['include'] ? $this->settings['include'] : array(), + 'exclude' => $this->settings['exclude'] ? $this->settings['exclude'] : array(), + 'number' => $this->settings['number'] ? $this->settings['number'] : 0, + 'parent' => $this->settings['parent'] ? $this->settings['parent'] : '', ); $categories = get_categories( $args ); From 155ada954c4472dabfc025340ac70a0b876bc9e1 Mon Sep 17 00:00:00 2001 From: mithu Date: Thu, 2 Nov 2017 11:18:04 +0600 Subject: [PATCH 2/2] Inlcude, exclude, number and parent settings options addded for multicheck categories --- lib/class-option-multicheck-categories.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/class-option-multicheck-categories.php b/lib/class-option-multicheck-categories.php index 63446b8d..f1b47a00 100644 --- a/lib/class-option-multicheck-categories.php +++ b/lib/class-option-multicheck-categories.php @@ -52,6 +52,10 @@ public function registerCustomizerControl( $wp_customize, $section, $priority = 'order' => $this->settings['order'], 'taxonomy' => $this->settings['taxonomy'], 'hide_empty' => $this->settings['hide_empty'] ? '1' : '0', + 'include' => $this->settings['include'] ? $this->settings['include'] : array(), + 'exclude' => $this->settings['exclude'] ? $this->settings['exclude'] : array(), + 'number' => $this->settings['number'] ? $this->settings['number'] : 0, + 'parent' => $this->settings['parent'] ? $this->settings['parent'] : '', ); $categories = get_categories( $args );