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', () => {
|
document.addEventListener( 'DOMContentLoaded', () => {
|
||||||
|
|
||||||
const adminMenu = document.getElementById( 'adminmenu' );
|
const addonsSubMenuLinks = document.querySelectorAll(
|
||||||
if ( ! adminMenu ) {
|
'#adminmenu' +
|
||||||
return;
|
' #toplevel_page_woocommerce' +
|
||||||
}
|
|
||||||
|
|
||||||
const addonsSubMenuLinks = adminMenu.querySelectorAll(
|
|
||||||
'#toplevel_page_woocommerce' +
|
|
||||||
' .wp-submenu' +
|
' .wp-submenu' +
|
||||||
' li a[href="admin.php?page=wc-addons"]'
|
' li a[href="admin.php?page=wc-addons"]'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue