More concise use of selectors, so we only do one lookup
Co-authored-by: Dan Q <dan@danq.me>
This commit is contained in:
parent
368abf3fd4
commit
732e5bd91b
|
@ -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"]'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue