[wp-trac] [WordPress Trac] #21652: wp_update_nav_menu_items returns false instead of WP_Error for non-existent menu items

WordPress Trac noreply at wordpress.org
Sun Feb 23 12:06:12 UTC 2014


#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:  3.9
Component:  Menus             |     Version:  3.4.1
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+--------------------
Changes (by ocean90):

 * keywords:  has-patch => has-patch commit
 * milestone:  Awaiting Review => 3.9


Comment:

 Hello mltsy and bootsz, thanks for the report and the patch.

 I agree, the error handling can be improved here. Since we already
 returning WP_Error objects we easily can add one more, so the change is
 backward compatible.

 We're doing similar checks on other places, like `wp_insert_term()` or
 `is_object_in_term()`, where we just declare the input as invalid. In
 [attachment:21652.2.patch] I have used a similar phrase. It changes also
 the operator of the first check, which was missed in 21652.patch.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21652#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list