I'm getting a menu in wordpress using this code
$items = wp_get_nav_menu_items( 'Top menu', $args );
It returns an array with items such as below
[4] => WP_Post Object
(
[ID] => 54
[post_author] => 1
[post_date] => 2014-02-19 20:36:53
[post_date_gmt] => 2014-02-19 20:36:53
[post_content] =>
[post_title] =>
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => 54
[to_ping] =>
[pinged] =>
[post_modified] => 2014-02-19 20:36:53
[post_modified_gmt] => 2014-02-19 20:36:53
[post_content_filtered] =>
[post_parent] => 7
[guid] => http://localhost:8888/eastleigh/?p=54
[menu_order] => 6
[post_type] => nav_menu_item
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
[db_id] => 54
[menu_item_parent] => 27
[object_id] => 46
[object] => page
[type] => post_type
[type_label] => Page
[url] => http://localhost:8888/eastleigh/about/menus/
[title] => Menus
[target] =>
[attr_title] =>
[description] =>
[classes] => Array
(
[0] =>
)
[xfn] =>
)
Seems fine, but when i go into wordpress the page doesn't have that ID , in fact no pages do ( i hovered of the pages in the admin to check the page_id). It does however match the object_id (46)
if i dump out the get_pages array then the same page has the current id (46)
[5] => WP_Post Object
(
[ID] => 46
[post_author] => 1
[post_date] => 2014-02-19 20:35:25
[post_date_gmt] => 2014-02-19 20:35:25
[post_content] =>
[post_title] => Menus
[post_excerpt] =>
[post_status] => publish
[comment_status] => open
[ping_status] => open
[post_password] =>
[post_name] => menus
[to_ping] =>
[pinged] =>
[post_modified] => 2014-02-19 20:35:25
[post_modified_gmt] => 2014-02-19 20:35:25
[post_content_filtered] =>
[post_parent] => 7
[guid] => http://localhost:8888/eastleigh/?page_id=46
[menu_order] => 0
[post_type] => page
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
Could someone please explain what i'm missing here?
Thank you