[wp-trac] [WordPress Trac] #28514: wp_get_nav_menu_items get_posts returns false when used on wp-admin/edit.php
WordPress Trac
noreply at wordpress.org
Thu Jun 12 21:52:44 UTC 2014
#28514: wp_get_nav_menu_items get_posts returns false when used on wp-
admin/edit.php
----------------------------+------------------------------
Reporter: evandentremont | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 3.9.1
Severity: normal | Resolution:
Keywords: | Focuses: administration
----------------------------+------------------------------
Changes (by SergeyBiryukov):
* component: Gallery => Menus
Old description:
> Works fine on wp-admin/index.php
> returns false on wp-admin/edit.php
>
> $args were correct and valid, yet get_post returns false.
>
> I was able to make it work via the following change
>
> /*$items = get_posts( $args );*/
> $menuitems = $items;
> $items = array();
> foreach($menuitems as $menuitem){
> $items[] = get_post($menuitem);
> }
New description:
Works fine on wp-admin/index.php
returns false on wp-admin/edit.php
$args were correct and valid, yet get_post returns false.
I was able to make it work via the following change
{{{
/*$items = get_posts( $args );*/
$menuitems = $items;
$items = array();
foreach($menuitems as $menuitem){
$items[] = get_post($menuitem);
}
}}}
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28514#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list