Some shortcode items not getting id
-
Hi there,
I love this plugin. Thanks for all your hard work. I am using jquery to apply properties to the menu items outputted by the plugin in shortcode form. Everything works fine except some menu items don’t get an id attribute. Here is an example of the output:
<li class="menu-item menu-item-type-post_type menu-item-object-page cmw-level-1 menu-item-419"> <li id="menu-item-418" class="menu-item menu-item-type-post_type menu-item-object-page cmw-level-1 menu-item-418"> <li class="menu-item menu-item-type-post_type menu-item-object-page cmw-level-1 menu-item-416">
You can see that only 1 items gets an id. I do have multiple versions of the same menu in some content but the items not getting an ID seems random.
I have solved my problem by using a function to get the last class from the li :
.attr('class').split(' ').pop();
but I am wondering if you are aware of this issue or know why it is happening as I would prefer not to have the extra code (and it is relying on the menu-item-### class being the last one)?
- The topic ‘Some shortcode items not getting id’ is closed to new replies.