Menu items id’s – are they 100% unique?

With regards the menu item id’s WP generates such as menu-item-814, are these 100% unique in nature?

I know they are unique at the time, but are they always unique? Meaning that if I was to delete something that had the id of 814, is it possible that some other menu item could now be assigned this ID? …or if WordPress was updated do they still keep the same ID’s?

Read More

I ask because I want to assign something to a certain menu button via JavaScript but on the off chance the button is removed I don’t want to be applied to a new button that has now been assigned that ID.

Related posts

Leave a Reply

1 comment

  1. Yes it is always unique. id 814 cant be applied again unless you update it manually on your DB.
    Its because of auto increment ..
    DB automatically increment id so everytime next id will be +1

    814

    815

    816

    and so on.. Even if you delete an id in between. It wont affect auto incrementation.

    Read MY SQL AUTO_INCREMENT for detailed understanding.