From ac9125dc4eaa43740907d1d5eb4771ff75be6d86 Mon Sep 17 00:00:00 2001 From: daomapsieucap Date: Tue, 21 Sep 2021 18:39:00 +0700 Subject: [PATCH] v1.1.1 - Fixed: Issue with custom taxonomy when enabling Custom Post Order --- CHANGELOG.md | 4 ++++ changelog.txt | 4 ++++ fiberadmin.php | 4 ++-- includes/cpo.php | 8 +++++--- readme.txt | 8 ++++---- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00fd400..b896134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## 1.1.1 - 2021-09-21 + +* Fixed: Issue with custom taxonomy when enabling Custom Post Order + ## 1.1 - 2021-09-16 * New: Duplicate post feature diff --git a/changelog.txt b/changelog.txt index c956ffd..11a03f1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ == Changelog == += 1.1.1 = +*Release Date - 21 September 2021* +* Fixed: Issue with custom taxonomy when enabling Custom Post Order + = 1.1 = *Release Date - 16 September 2021* diff --git a/fiberadmin.php b/fiberadmin.php index 246d5b2..b8647d4 100644 --- a/fiberadmin.php +++ b/fiberadmin.php @@ -3,7 +3,7 @@ * Plugin Name: Fiber Admin * Plugin URI: https://wordpress.org/plugins/fiber-admin/ * Description: 💈 Another helpful tool for WordPress admin - * Version: 1.1 + * Version: 1.1.1 * Requires at least: 5.2 * Requires PHP: 7.2 * Author: Dao Chau @@ -25,7 +25,7 @@ * Definitions */ -define('FIBERADMIN_VERSION', '1.1'); +define('FIBERADMIN_VERSION', '1.1.1'); define("FIBERADMIN_DIR", plugin_dir_path(__FILE__)); define("FIBERADMIN_ASSETS_URL", plugin_dir_url(__FILE__) . 'assets/'); diff --git a/includes/cpo.php b/includes/cpo.php index ff0ff7e..59a85c7 100644 --- a/includes/cpo.php +++ b/includes/cpo.php @@ -98,7 +98,8 @@ public function fiad_cpo_update_order($query){ if($query->is_main_query()){ if(is_admin()){ // Change post order by default in admin - if(fiad_is_screen_sortable()){ + $screen = get_current_screen(); + if(fiad_is_screen_sortable() && !$screen->taxonomy){ $query->set('orderby', 'menu_order'); $query->set('order', 'ASC'); } @@ -166,8 +167,9 @@ public function fiad_cpo_tax_update(){ public function fiad_cpo_update_term_order($orderby, $query_vars, $taxonomies){ if(is_admin()){ - // Change post order by default in admin - if(fiad_is_screen_sortable()){ + // Change taxonomy order by default in admin + $screen = get_current_screen(); + if(fiad_is_screen_sortable() && $screen->taxonomy){ return 't.term_order'; } }else{ diff --git a/readme.txt b/readme.txt index 5c5d6b3..38397f5 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: white label, admin login, admin tool Requires at least: 4.7 Tested up to: 5.8 Requires PHP: 5.6 -Stable tag: 1.1 +Stable tag: 1.1.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -35,7 +35,7 @@ Another helpful tool for WordPress admin help you do more cool things in WordPre == Changelog == -= 1.1 = -*Release Date - 16 September 2021* += 1.1.1 = +*Release Date - 21 September 2021* -* New: Duplicate post feature \ No newline at end of file +* Fixed: Issue with custom taxonomy when enabling Custom Post Order \ No newline at end of file