Skip to content

Instantly share code, notes, and snippets.

@coderaaron
Created March 11, 2020 13:42
Show Gist options
  • Save coderaaron/0a2c504e01316c53b7f884d99986ed62 to your computer and use it in GitHub Desktop.
Save coderaaron/0a2c504e01316c53b7f884d99986ed62 to your computer and use it in GitHub Desktop.
SELECT
c.post_title,
c.post_content
FROM
wp_posts a,
wp_postmeta b
LEFT JOIN
wp_posts c
ON
c.ID = b.meta_value
WHERE
a.post_type = 'nav_menu_item' AND
b.meta_key = '_menu_item_object_id' AND
a.ID = b.post_id
ORDER BY
a.menu_order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment