[wp-trac] [WordPress Trac] #13822: Menu items that get unpublished still appear

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 13 09:20:04 UTC 2010


#13822: Menu items that get unpublished still appear
------------------------------------+---------------------------------------
 Reporter:  nacin                   |        Owner:  nacin    
     Type:  defect (bug)            |       Status:  reviewing
 Priority:  highest omg bbq         |    Milestone:  3.0      
Component:  Menus                   |      Version:  3.0      
 Severity:  major                   |   Resolution:           
 Keywords:  has-patch dev-feedback  |  
------------------------------------+---------------------------------------
Changes (by nacin):

  * keywords:  dev-feedback => has-patch dev-feedback


Comment:

 Patch from koopersmith and me reverts [15219] and makes some important
 changes to properly fix this ticket:

  - wp_nav_menu() now passes an argument to wp_get_nav_menu_items(),
 telling that function to use a wrapper for wp_setup_nav_menu_item(), which
 would then filter out unpublished posts, only on the frontend, and during
 menu display, not on any hooks.

  - Menu items that are associated with a post that is unpublished now gets
 a status after it, such as "(Draft)" and "(Pending)", using the post
 status object label.

  - "(Pending)" in non-JS becomes "(Unsaved)" because "Pending" is an
 existing status we also need to display. '''i18n-change''', we're adding
 "%s (Unsaved)". Also, "Click Save Menu to make pending menu items public."
 becomes "Click Save Menu to make unsaved menu items public."
 (Redundant/obvious, but a yellow warning never hurt.)

  - Removes the trash/untrash post hooks and other special trash handling.
 They didn't work properly, as they should have returned the menu item to
 the end of the menu on untrash. Now, we handle it like other stati, i.e.
 "(Trash)". '''i18n-change''', we're adding "Original: %1$s (%2$s)", that
 way we reflect the status here too.

 This patch is scary -- there's a lot being changed, or so it seems. I
 think we should do this in pieces, at least two commits if not more.
 First, revert [15219], then fix frontend, labels, and trash. Once [15219]
 is out it'll look much more sane.

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


More information about the wp-trac mailing list