A current limitation is that if you have a post/page/term in the nav menu, and you update the title of that page, then it will not be updated in the nav menu unless you go and save the nav menu to trigger a cache clearance.
We can loop through all nav menus and check for the presence of the updated post/term and clear the nav menu cache if found.
I was a little concerned that this may not be performant enough to run on post_updated, if you have a lot of nav menus, with lots of items. Which is why I moved it to a cron.
A current limitation is that if you have a post/page/term in the nav menu, and you update the title of that page, then it will not be updated in the nav menu unless you go and save the nav menu to trigger a cache clearance.
We can loop through all nav menus and check for the presence of the updated post/term and clear the nav menu cache if found.
I was a little concerned that this may not be performant enough to run on
post_updated
, if you have a lot of nav menus, with lots of items. Which is why I moved it to a cron.