[wp-trac] [WordPress Trac] #21652: wp_update_nav_menu_items returns false instead of WP_Error for non-existent menu items
WordPress Trac
wp-trac at lists.automattic.com
Tue Aug 21 16:57:46 UTC 2012
#21652: wp_update_nav_menu_items returns false instead of WP_Error for non-existent
menu items
--------------------------+-----------------------------
Reporter: mltsy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
'''Use case:'''
Calling wp_update_nav_menu_items with a non-existent menu_item_id as the
first parameter
'''Expected return value:''' WP_Error object (as per the method's
documentation)
'''Actual return value:''' Boolean false
'''Fix:''' wp-includes/nav-menu.php#L279 - This line should check for a
false value first, and if `$menu == false`, set it equal to a `new
WP_Error` object - then check `is_wp_error($menu)`
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21652>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list