Is it possible to return the Page ID of menu items?
I specifically looking to get the IDs that appear in a rollover submenu.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIs it possible to return the Page ID of menu items?
I specifically looking to get the IDs that appear in a rollover submenu.
Hook int 'wp_nav_menu_objects'
. You get a list (an array) of all found menu items as an array. Each item is an object, and each one has a property named ID
. That's the ID of the original object if it was a post object.
In your filter callback just iterate over these items, collect the IDs and use them later in your custom query.