Hello back.
I couldn’t find any way to exclude the nav_menu_item’s from the requests, so I tried the other way around : altering the post_name at insert time.
So, here is a function to add to a ‘wp_insert_post’ action hook :
add_action(‘wp_insert_post’, ‘nav_menu_items’, 8);
[Code moderated as per the Forum Rules. Please use the pastebin]
Important Notice : the wp_insert_post hook is actually called at the end of the insert/update function and I couldn’t find a way to limit it to the inserts only. The overhead doesn’t seem too high so I think it’s OK. And it will solve the problem for all pre-existing menus.
Enjoy ??