[wp-trac] [WordPress Trac] #21773: Scheduled pages/posts should not appear in custom menus

WordPress Trac noreply at wordpress.org
Thu Apr 28 22:49:45 UTC 2016


#21773: Scheduled pages/posts should not appear in custom menus
-------------------------------------+------------------------------
 Reporter:  Lorangeo                 |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Menus                    |     Version:  3.0
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:
-------------------------------------+------------------------------
Changes (by dkotter):

 * keywords:  needs-patch needs-testing => needs-testing has-patch


Comment:

 Added a patch that makes sure any menu items that are of the type
 post_type (so posts, pages, CPTs) don't show on the front-end if they
 don't have the publish status. So this will remove scheduled items, draft
 items and private items from showing up.

 I wasn't sure on the best place to put this, as there is a
 `_is_valid_nav_menu_item` function that I thought maybe extending to
 include this functionality might make sense, but ultimately I just created
 a similar function to handle this.

 I have tested this and it seems to work great, but am open to any ideas if
 there's a better way to approach this or better place to put this.

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


More information about the wp-trac mailing list