[wp-hackers] Get nav menu items associted to a post for a specific menu

Lox lox.dev at knc.nc
Tue Jul 27 06:38:35 UTC 2010


Hello,

There is the wordpress function wp_get_associated_nav_menu_items
(http://gist.github.com/491844) but it returns associated menu items
from all menus. Menus are terms, how can I alter that wp_query:

 $query = new WP_Query;
$menu_items = $query->query(
array(
'meta_key' => '_menu_item_object_id',
'meta_value' => $object_id,
'post_status' => 'any',
'post_type' => 'nav_menu_item',
'showposts' => -1,
)
);

To include a term parameter?

-- 
Lox
lox.dev at knc.nc


More information about the wp-hackers mailing list