WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#18352 closed defect (bug) (fixed)

Quick Edit / page-attributes for non-hierarchical custom post type

Reported by: s1m0nd Owned by: nacin
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.2.1
Component: Administration Keywords: has-patch close dev-feedback
Focuses: Cc:

Description

I want to use Page Order to enable users to alter the display order for a custom post type; but I don't want parent/child relationships between the posts. I'm registering the post type (broadly) as follows:

register_post_type('feature',array(
	'label' => 'Features',
	'show_ui' => true,
	'hierarchical' => false,
	'supports' => array('title','excerpt','page-attributes'),
));

'Order' appears under 'Attributes' on the main edit screen, as it should; but doesn't then appear as a Quick Edit option.

If I change 'hierarchical' to true, I see 'Parent' and 'Order' on the main Edit screen, which makes sense. But in Quick Edit, I see 'Parent', 'Order' and now additionally, 'Template'.

Attachments (1)

18352.diff (1.1 KB) - added by duck_ 3 years ago.

Download all attachments as: .zip

Change History (9)

duck_3 years ago

comment:1 duck_3 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.3

Patch attached brings Quick Edit more inline with the attributes metabox. Order will show when 'page-attributes' is supported. Template choice is only shown for pages.

The difference between the main editing page and quick edit, even after the patch, is the display of the parent dropdown for hierarchical post types even when they do not support 'page-attributes'.

Edit: typo fix.

Last edited 3 years ago by duck_ (previous) (diff)

comment:2 follow-up: scribu3 years ago

  • Keywords close added

Altering the order of items by manually entering a number is likely the most user-unfriendly UI possible.

I don't think we should encourage developers to use it.

Alternative: Make the list table of that post type sortable; trivial to do using jQuery UI.

Last edited 3 years ago by scribu (previous) (diff)

comment:3 in reply to: ↑ 2 duck_3 years ago

Replying to scribu:

Altering the order of items by manually entering a number is likely the most user-unfriendly UI possible.

I totally agree, but I don't think that warrants the closure of this ticket at this time. This is a bug fix for the current implementation which I think should remain open (and be applied) until there is a solid plan and/or patch for a better system of ordering.

Alternative: Make the list table of that post type sortable; trivial to do using jQuery UI.

Drag and drop or clicky arrows, both like the nav menu system, sounds like a good candidate for future work.

comment:4 scribu3 years ago

I meant that as something he could implement in his plugin.

Core doesn't really need ordering for pages, since we have custom menus.

Related: #14333

comment:5 s1m0nd3 years ago

I totally agree with duck_. Whether or not page ordering by inputting numbers is the optimal method in 2011, it's currently broken, and if it's so (relatively) trivial to fix, then shouldn't we?

I take your point, scribu, but fixing this defect won't encourage a single additional developer to use the function. It's just an annoyance for those of us who, for whatever reason (and I have my reasons), are already using it.

comment:6 simonwheatley3 years ago

  • Keywords dev-feedback added

+1 for fixing the current implementation.

(+1 for adding draggable sorting to core, FWIW, but let's make the fixes where we find them as we move towards that… there's a lot of work needed on the current list tables implementation, as we are all pretty well aware)

comment:7 nacin3 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [18527]:

Properly handle display of Order, Template, and Parent page attributes in Quick/Bulk Edit. props duck_, fixes #18352.

comment:8 duck_2 years ago

In [19929]:

Display menu_order value in quick edit for non-hierarchical post types. Props nikolay.yordanov. Fixes #19911, see #18352.

Note: See TracTickets for help on using tickets.