Changeset 3108797
- Timestamp:
- 06/27/2024 02:45:01 PM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin-menu-editor/trunk/includes/menu-editor-core.php
r3106195 r3108797 4355 4355 4356 4356 /** 4357 * Compatibility fix for WooCommerce 2.2.1+. 4358 * Summary: When AME is active, an unusable WooCommerce -> WooCommerce menu item shows up. Here we remove it. 4359 * 4360 * WooCommerce creates a top level "WooCommerce" menu with no callback. By default, WordPress automatically adds 4361 * a submenu item with the same name. However, since the item doesn't have a callback, it is unusable and clicking 4362 * it just triggers a "Cannot load woocommerce" error. So WooCommerce removes this item in an admin_head hook to 4363 * hide it. With AME active, the item shows up anyway, and users get confused by the error. 4364 * 4365 * Fix it by removing the problematic menu item. 4366 * 4367 * Caution: If the user hides all WooCommerce submenus but not the top level menu, the WooCommerce menu will still 4368 * show up but be inaccessible. This may be slightly counter-intuitive, but seems reasonable. 4357 * Compatibility fixes for WooCommerce. 4369 4358 */ 4370 4359 private function apply_woocommerce_compat_fix() { … … 4373 4362 } 4374 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4375 4380 $badSubmenuExists = isset($this->default_wp_submenu['woocommerce'][0][2]) 4376 4381 && ($this->default_wp_submenu['woocommerce'][0][2] === 'woocommerce'); … … 4380 4385 $this->default_wp_submenu['woocommerce'][0] = $this->default_wp_submenu['woocommerce'][1]; 4381 4386 unset($this->default_wp_submenu['woocommerce'][1]); 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4382 4410 } 4383 4411 }
Note: See TracChangeset
for help on using the changeset viewer.