Open SeanDS opened 6 years ago
@SeanDS Off the top of your head, do you know whether the Classic Editor permits reordering right now (without custom code)?
Hi @danielbachhuber: no it doesn't, but I'm curious about why not. The behaviour of the core code in preserving submitted term order suggests that order is considered important. WordPress saves the submitted terms in the order they are defined (using the term_order
column in the database) and the old editor then presents the terms in that order when the post is edited later. I think Gutenberg should go the extra step and first of all display terms in the order they are defined like the old editor does (see #6688) but then also allow reordering. If this behaviour is considered disruptive for existing plugins for whatever reason, then at very least I hope we could have a flag in register_taxonomy
to enable this behaviour, given that it seems like order was always meant to be important.
As you have worked on the Co-Author Plus plugin, you will know that this requires a separate author meta box despite actually using custom terms to set the post coauthors. I want to be able to use the default non-hierarchical term meta box that WordPress generates for custom taxonomies to set coauthors natively, and I've got this working exactly how I want it except that reordering authors with drag and drop is not yet possible. It seems like all of the functionality is present in WordPress Core to allow order to be saved and displayed, but the editor just lacks the drag-and-drop controls to do it. The new block editor presents a great opportunity to add this functionality, that probably should have already been in the old editor!
Happy to help with testing etc. if you decide this is a worthy feature.
Makes sense, thanks for clarifying :)
At this point, I think this feature is low priority in the grand scheme of things. However, we can explore the idea in the context of: 1) making sure Gutenberg has feature-parity with the Classic Editor, and 2) permitting Gutenberg to be sufficiently extensible for reasonable use-cases.
Just checking in on this request - to see if it's something that is still relevant and needed?
Yes, tags still cannot be reordered in the editor and in fact it appears that since the original post, Gutenberg even forcefully reorders custom tags alphabetically rather than by definition order even when the custom taxonomy registration specifies term_order
as the orderby
setting.
@jarekmorawski I am pinging you as perhaps the tags feature needs an update?
Is your feature request related to a problem? Please describe. Currently it's not possible for the user to reorder tags or non-hierarchical taxonomy terms in the Gutenberg editor. While this is not usually important for tags, other taxonomies may have a desired order other than alphabetical (for example, I'm making a coauthor plugin where author order is important). Since WordPress saves tags and non-hierarchical terms in the order it receives them, control should be given to the user to allow this.
This work probably goes hand-in-hand with #6688.
Describe the solution you'd like The ability to reorder tags using some sort of drag-and-drop interface. JQuery has such a module to easily facilitate this, and it seems React does too.
If the developers don't want this feature to be enabled by default, consider adding it as an optional flag in
register_taxonomy
.Describe alternatives you've considered The only way to reorder terms is currently to delete the terms and add them back in the order you want. The terms are then submitted in this order, and WordPress saves them in this order, but then due to the issue described in #6688 the terms are retrieved in alphabetical order when the post is edited again.