Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.