WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#37164 closed defect (bug) (duplicate)

WP Menu outputs posts with status "Draft" or "Pending"

Reported by: kshengelia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.5.3
Component: Menus Keywords: dev-feedback
Focuses: administration, template Cc:
PR Number:

Description

When using "wp_get_nav_menu_items" function to output menu items, we are getting posts of any status - Published, Draft or Pending.

We have covered getting inactive posts in our framework by having a dedicated function for it but "wp_get_nav_menu_items" is core function and probably it should be done in core as well.

So, the end result would be that if I put inactive posts into menu, this function should filter those posts and output only active posts.

Change History (4)

#1 @kshengelia
3 years ago

  • Keywords dev-feedback added

#2 @michalzuber
3 years ago

I couldn't reproduce. In the menus the 'View all' list there's only the public one.

http://i.imgur.com/ZfwonH6.png

#3 @kshengelia
3 years ago

@michalzuber That works. Let's say "I'm draft post" is active and you are able to add it to menu.

Then, status of that post is changed to draft again. However, it was already added to menu when it was active. This is my case.

#4 @dd32
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #13822.

Note: See TracTickets for help on using tickets.