Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
Created July 28, 2010 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeschinkel/493195 to your computer and use it in GitHub Desktop.
Save mikeschinkel/493195 to your computer and use it in GitHub Desktop.
<?php
include "wp-load.php";
$post_id = $_GET['post'];
$menu_id = $_GET['menu'];
$term = get_term($menu_id, 'nav_menu');
$menu_items = new WP_Query(
array(
'post_type' => 'nav_menu_item',
'post_status' => 'any',
'meta_key' => '_menu_item_object_id',
'meta_value' => $post_id,
'showposts' => -1,
'taxonomy' => 'nav_menu',
'term' => $term->slug,
)
);
header('Content-type:text/plain');
print_r($menu_items->posts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment