From 0e1ec203cd8f313932bf9a0d1c3f6b23490d243a Mon Sep 17 00:00:00 2001 From: Alex Sanford Date: Thu, 19 Jul 2018 17:39:41 -0300 Subject: [PATCH] Allow custom menu ordering when set by another filter This fixes the case where another plugin sets custom menu ordering to be true, but its filter runs before WooCommerce's filter. Otherwise WooCommerce's filter will return false, and disallow the other plugin to customize its menu items. --- includes/admin/class-wc-admin-menus.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/admin/class-wc-admin-menus.php b/includes/admin/class-wc-admin-menus.php index e15c6b3fe78..cfe052da251 100644 --- a/includes/admin/class-wc-admin-menus.php +++ b/includes/admin/class-wc-admin-menus.php @@ -215,10 +215,11 @@ class WC_Admin_Menus { /** * Custom menu order. * + * @param bool $enabled Whether custom menu ordering is already enabled. * @return bool */ - public function custom_menu_order() { - return current_user_can( 'manage_woocommerce' ); + public function custom_menu_order( $enabled ) { + return $enabled || current_user_can( 'manage_woocommerce' ); } /**