From 7af6151d502ccb9b7b5480b96c09623eef13c50c Mon Sep 17 00:00:00 2001 From: Johannes Kinast Date: Fri, 18 Dec 2020 11:23:27 +0100 Subject: [PATCH] Check all taxonomies if any of them should be sorted --- simple-custom-post-order.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/simple-custom-post-order.php b/simple-custom-post-order.php index 6b3ebcf..4c4e5ed 100644 --- a/simple-custom-post-order.php +++ b/simple-custom-post-order.php @@ -552,26 +552,10 @@ public function scporder_get_terms_orderby($orderby, $args) { $tags = $this->get_scporder_options_tags(); - if (!isset($args['taxonomy'])) + if (0 === count(array_intersect((array) $taxonomy, array_values($tags)))) return $orderby; - - if(is_array($args['taxonomy'])){ - if(isset($args['taxonomy'][0])){ - $taxonomy = $args['taxonomy'][0]; - } else { - $taxonomy = false; - } - - } else { - $taxonomy = $args['taxonomy']; - } - - - if (!in_array($taxonomy, $tags)) - return $orderby; - - $orderby = 't.term_order'; + $orderby = 't.term_order,' . $orderby; return $orderby; }