Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#37164 closed defect (bug) (duplicate)

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

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

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
10 years ago

  • Keywords dev-feedback added

#2 @michalzuber
10 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
10 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
10 years ago

  • Milestone Awaiting Review
  • Resolution → duplicate
  • Status new → closed

Duplicate of #13822.

Note: See TracTickets for help on using tickets.