WordPress.org

Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#12655 closed defect (bug) (fixed)

"Parent" dropdown missing when only 1 page present

Reported by: dd32 Owned by: sorich87
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

At present, if you edit a hierarchical post type (Page, or custom type) and have only 1 page OR only have 1 top level page, The "Parent" dropdown list will be hidden.

The title and description remain, but there is no selection box.

This is due to wp_dropdown_pages() only displaying the <select> if pages are present.

One solution is to hide the entire parent functionality until pages are available
Another is to leave as-is
And another is to force the display of the <select> element even with no pages (Either all the time, or only when $show_option_none is set potentially..

While this would rarely be run into, It can cause some confusion for custom post_types which are more likely to have fewer entries.

Thoughts?

Attachments (1)

page_attributes_meta_box_patch.diff (1.4 KB) - added by sorich87 12 years ago.

Download all attachments as: .zip

Change History (4)

#1 @sorich87
12 years ago

  • Cc sorich87 added
  • Keywords has-patch added
  • Owner set to sorich87
  • Status changed from new to accepted

I think it is better to hide the 'Parent' attribute to avoid confusion.

#2 @dd32
12 years ago

I'm not 100% hiding the Parent dropdown is the best option available, It introduces a UI mis-match a bit.

But at the same time, Other elements are hidden if they're not usable.

#3 @dd32
12 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [14232]) Hide Parent dropdown in Page-attributes metabox when no potential parents exist. Props sorich87. Fixes #12655

Note: See TracTickets for help on using tickets.