• Resolved MrSnoozles

    (@mrsnoozles)


    Hi,

    and thank you for this wonderful plugin. It works exceptionally well, except for a small bug that affects some menu entrys.

    In assets/js/admin-popups.js you’re creating the checkbox values with
    let key = $( this ).attr( 'href' ); (lines 40 and 85)

    That is not always the correct slug. Then some menu items won’t be always shown or always hidden, although they were selected. You can confirm that by adding “Auto hide menu” to the list of always hidden menu items. It won’t work.

    The correct slug is in the <li> class, e.g. toplevel_page_aham_settings -> the correct slug is aham_settings. So to fix the bug you would have to change above line to

    let key = $(this).parent().attr('class').match(/toplevel_page_(.+?)(?=\s|$)/);
    key = key ? key[1] : $( this ).attr( 'href' );

    • This topic was modified 3 years, 7 months ago by MrSnoozles.
    • This topic was modified 3 years, 7 months ago by MrSnoozles.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Small bug (.attr(‘href’) is not the slug)’ is closed to new replies.