diff --git a/plugins/woocommerce/client/legacy/js/admin/wc-admin-menu.js b/plugins/woocommerce/client/legacy/js/admin/wc-admin-menu.js index 235b3f93e2b..6d706f32340 100644 --- a/plugins/woocommerce/client/legacy/js/admin/wc-admin-menu.js +++ b/plugins/woocommerce/client/legacy/js/admin/wc-admin-menu.js @@ -1,12 +1,8 @@ document.addEventListener( 'DOMContentLoaded', () => { - const adminMenu = document.getElementById( 'adminmenu' ); - if ( ! adminMenu ) { - return; - } - - const addonsSubMenuLinks = adminMenu.querySelectorAll( - '#toplevel_page_woocommerce' + + const addonsSubMenuLinks = document.querySelectorAll( + '#adminmenu' + + ' #toplevel_page_woocommerce' + ' .wp-submenu' + ' li a[href="admin.php?page=wc-addons"]' );