Say you have custom menus enabled with your WP theme. Is there any action associated with saving a menu once you’ve arranged it accordingly? To further clarify: say you’ve arranged a menu with some links and some posts, how might you get the titles of the posts in said menu upon saving (clicking the “Save Menu” button)?
Leave a Reply
You must be logged in to post a comment.
At least in 3.4.1, there is an action for that: wp_update_nav_menu
See here.
Then you can get the items in your menu with something like:
There is no dedicated action for your needs, but you can misuse the
'check_admin_referer'
hook. See theswitch ( $action )
block inwp-admin/nav-menus.php
for details and other options.Sample code for a start: