Skip to content

Instantly share code, notes, and snippets.

@s28491
s28491 / allib-menu-sorted-query.php
Created November 16, 2017 10:12 — forked from eoinkelly/allib-menu-sorted-query.php
Get all posts included in a WordPress Menu, sorted in the order they appear in the menu
<?php
/*
* This is a convenient wrapper that allows you to retrieve the list of posts
* mentioned in a Menu. The posts are returned in the order they are in the menu.
* Args: An array containing these keys:
* theme_location: (required) the name of the theme location you have defined
* for the menu with register_nav_menu()