[wp-trac] [WordPress Trac] #17821: wp_get_nav_menu_object() doesn't check when passing to get_term()

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 17 15:58:33 UTC 2011


#17821: wp_get_nav_menu_object() doesn't check when passing to get_term()
--------------------------+------------------------------
 Reporter:  kawauso       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Menus         |     Version:  3.1.4
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by kawauso):

 `wp_get_nav_menu_to_edit()` incorrectly passed the menu object to
 `is_nav_menu()` (it is only meant to take an id, slug or name). Following
 patch adds check logic from `is_nav_menu()` in place of the
 `is_nav_menu()` call.

 `wp_get_nav_menu_to_edit()` can still return `null` when the conditions
 are not met, so the PHPDoc `@return` should be expanded to reflect this or
 handling added to convert `null` values into `WP_Error` objects.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17821#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list