Opened 3 weeks ago
Last modified 3 weeks ago
#62853 new feature request
Order posts and terms by drag and drop from administration
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | |
Focuses: | Cc: |
Description
Would it be possible to order post types and taxonomy terms by drag and drop from the back office so that the WP_Query orderby could be directly modified?
This would be the default orderby if no orderby is specified.
We could therefore order directly in post types 'post', 'page' and those created with register_post_type(), but also in taxonomy terms created with register_taxonomy().
This would natively reproduce the functionality added by these plugins, for example :
https://wordpress.org/plugins/simple-custom-post-order/
https://fr.wordpress.org/plugins/post-types-order/
Change History (2)
#2
@
3 weeks ago
Hello @knutsp thanks for your feedback !
yes in fact for the posts I agree, I can understand that it can change the default operation and break things with plugins or other. There's little point in ordering posts manually.
The biggest interest lies in taxonomy terms and pages.
Manual page ordering can be really useful when creating structures with child pages, and automatically retrieving all these child pages with get_posts() or get_post_ancestors() to create a navigation menu.
So maybe this orderby wouldn't be present by default but rather as a parameter to be passed in query, so it could be applied to any type of post-type including posts ?
For example :
'orderby' => 'manual',
'orderby' => 'drag_and_drop',
'orderby' => 'user_choice'
Hello @dhenriet and welcome to Trac!
Thank you for the suggestions. Here is my view:
Core support for easy ordering of terms and custom post types would be nice. Many plugins already do this, like WooCommerce, for products itself and their product attribute taxonomies. Bringing this feature to core makes sense. This could be an argument when registering them.
For the builtin post type
post
, the very heart and foundation for WordPress, the whole point is ordering by date published, with the exception of sticky posts (assumed high importance posts). These properties is part of the identity of posts, a design decision, and something to be expected. If anything else is needed, then either a plugin, or a custom post type, should be used.For the builtin post type
page
, ordering is respected by default, but since pages are rarely listed, mostly appearing single, or as hierarchically ordered, instances, and usually added to menues in the desired order, this would be of less use, I guess, but no harm.So for all taxonomy terms (built in and custom), I like it. And for all custom post types, maybe also pages, by default.