[wp-trac] [WordPress Trac] #13958: Deactivating custom post types/taxonomies breaks nav menus

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 23 05:49:32 UTC 2011


#13958: Deactivating custom post types/taxonomies breaks nav menus
----------------------------------------------+----------------------------
 Reporter:  WraithKenny                       |       Owner:  filosofo
     Type:  defect (bug)                      |      Status:  accepted
 Priority:  normal                            |   Milestone:  Future
Component:  Menus                             |  Release
 Severity:  normal                            |     Version:  3.0
 Keywords:  3.2-early has-patch dev-feedback  |  Resolution:
----------------------------------------------+----------------------------
Changes (by garyc40):

 * keywords:  needs-patch 3.2-early => 3.2-early has-patch dev-feedback


Comment:

 I just attached another patch that's a bit different from how filosofo's
 patch handles this issue:

 * If post type or taxonomy is invalid, post_status is draft.

 * Walker class is not touched. Instead, draft items are filtered again
 within `wp_get_nav_menu_items()`. Otherwise, draft items would still be
 returned when calling `wp_get_nav_menu_items($menu, array('post_status' =>
 'publish')`, which is unexpected behavior.

 * The invalid menu items are not touched as well, even when the menu is
 saved. The 'draft' post status is dubbed on the fly.

 As a result, when a plugin with custom tax or post type is disabled, then
 enabled again, its menu items won't go away.

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


More information about the wp-trac mailing list