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.
This commit is contained in:
Alex Sanford 2018-07-19 17:39:41 -03:00
parent b9cdc760ac
commit 0e1ec203cd
1 changed files with 3 additions and 2 deletions

View File

@ -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' );
}
/**