First, thanks for a nice plugin. I was searching for various solutions for this problem without modifing the core and this one seems to be best so far.
I think I've found a bug. There seems to be missing 'last' class on the item when it has children.
For examaple if I have just two 1st level pages it works fine:
<li>Print</li> <- adds first. Correct! <li>Webdesign</li> <- add last. Correct!
Problem appears however when you add children to the last item:
<li>Print</li> <- adds first. Correct! <li>Webdesign <ul> <li>Test</li> <- adds first & last. Correct! </ul> </li> <- here however last 1st lvl item - Webdesign - isn't tagged with .last class
Here's the sample output:
<ul> <li class="first portfolio-print page_item page-item-42"><a href=".." title="Print">Print</a></li> <li class="portfolio-webdesign page_item page-item-40 current_page_ancestor current_page_parent"><a href=".." title="webdesign">webdesign</a> <ul> <li class="last first portfolio-webdesign-test-third-level page_item page-item-44 current_page_item"><a href=".." title="test third level">test third level</a></li> </ul> </li> </ul>
I know it's tricky with RegEx, hope you could find some solution for that :).