Support for sub-headings
Thank you for making this available! It really helped me out.
You included functionality for the dividers (thank you!) but not the sub-headings, as far as I can tell. I ended up adding that functionality myself, in case anyone else would be interested in what I did.
I changed this if statement:
if (strcasecmp($item->title, 'divider') && strcasecmp($item->title, 'heading')) {
And the else statement:
} elseif (strcasecmp($item->title, 'heading')) { /* it's a divider */ $output .= $indent . '<li class="divider">'; } else { /* it's a sub-heading */ $output .= $indent . '<li class="nav-header">' . esc_attr( $item->attr_title ); }
Then you can use the headings by putting the word heading in the menu item label and the actual heading text in the title attribute.
This seems to be working for me, however, I'm no expert, so there may be a better way. But this may help someone out, so I wanted to share it.
Cheers!
That is actually pretty genius, I wanted to implement sub-headings but wanted ti use the standard UI. I didn't even think of using the Title Attribute field.
I believe I will whip something similar up and add it to the main class.
Thanks for the tip!
Great! So glad to have been helpful since your code was so helpful to me. This is the first time I've ever contributed something to a project.
That would be great!
I actually use javascript to convert my headers and dividers at the moment (I didn't realise there was a divider d'oh!)
Looking forward to this being added.
Rob
I have updated the script to support navigation headers as @nerdworker suggested, and that are now supported as of version 1.3, see the Extras section of the read me for how to implement them in WordPress.