[wp-trac] [WordPress Trac] #33742: Menu Customizer: Adding draft items?

WordPress Trac noreply at wordpress.org
Thu Aug 18 22:48:27 UTC 2016


#33742: Menu Customizer: Adding draft items?
------------------------------------+-----------------------------
 Reporter:  pavelevap               |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  4.7
Component:  Menus                   |     Version:  4.3
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  administration
------------------------------------+-----------------------------
Changes (by westonruter):

 * milestone:  Awaiting Review => 4.7


Comment:

 @welcher thanks for raising this. Interesting. It does seem like a glitch
 (hack?) that nav menu items for draft posts/pages can be added to a nav
 menu, and remain in the nav menu even when an unauthenticated user is
 viewing. I would have thought such nav menu items would have been removed
 on the frontend in the same way as `_is_valid_nav_menu_item` is filtering
 ones that are `_invalid`. I'm not sure if this is a defect or a feature.
 If a defect, then I think your patch is correct. If a feature, then
 `draft` posts should be discoverable in the customizer as well. If a
 feature, this is closely related to #34923 since it involves adding nav
 menu items for `auto-draft` posts. I'm adding this ticket to the 4.7
 milestone for this reason.

 (Something else to note about nav menu items: the
 `wp_update_nav_menu_item()` function actually allows the `nav_menu_item`
 post itself to be made a `draft` (if you supply `'menu-item-status' =>
 'draft'`). See [attachment:draft-nav-menu-items.png] for how the nav menu
 admin page looks when there is a nav menu item with a `draft` status (the
 blue notice and the word “(Pending)” after the nav menu item label). I've
 never ever seen this UI before today, although I have seen the reference
 to it in the code which I had to manually call to get this UI to appear. I
 don't think there is any UI to create draft nav menu items.)

 @celloexpressions What are your thoughts on this? Is it a hidden feature
 to be able to add non-published posts to a nav menu? Or is it a defect?

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


More information about the wp-trac mailing list