wp-tag-order
wp-tag-order copied to clipboard
Tag order for hierarchical taxonomy
Hello,
What a nice plug-in ! After many weeks, i found your plug-in, i tried and it's what i need. But, do you think it could be possible to apply that to a hierarchical taxonomy ?
Regards
@FabienArr Thanks for your feedback.
Unfortunately I don't think it's possible because the order terms in hierarchical taxonomy have a different structure.
Thank you for your fast reply. I don't explore yet your sources, but what i analyse in the database, it's that there is no difference in wordpress storage between hierarchical and non-hierarchical taxonomy.
The only difference, it's in the metabox to choose the taxonomy which are checkboxes and not input.
@FabienArr What makes this difficult is the different HTML structure between hierarchical and non-hierarchical taxonomy in Meta Box of the edit page, not the database structure.
It's about your Meta Box or Wordpress Meta box ?
@FabienArr It's about WordPress Meta Box.
Ok, you launch your script on "Add" button but with hierarhical there is no button "Add" so it needs to track each checkbox, it's that ?
@FabienArr
that's right.
There are structural differences.
This plugin specializes in non-hierarchical taxonomy
. If we need hierarchical taxonomy
support, I think it should be developed as a separate plugin.
Ok, could you just tell me if i'm right : You detect changes in taxonomy list with eventlistener :
jQuery("[id^='tagsdiv-']")
.find('.tagchecklist')
.on('DOMSubtreeModified propertychange'
And after you do a request to get the terms of the taxonomy ?
Can we just add another listener on input modification ?
because checked is like that :
<input value="25" type="checkbox" name="tax_input[localisation][]" id="in-localisation-25">::before</input>
and unchecked like this :
<input value="25" type="checkbox" name="tax_input[localisation][]" id="in-localisation-25">
But when we checked, the database is not update i think.
@FabienArr
And after you do a request to get the terms of the taxonomy ?
Submit request after detect changes in taxonomy list.
Since this plugin is not supposed to support hierarchical taxonomy in the first place, I'll have to check that. Sorry, but I don't have enough time to test to answer this right now.
@sectsect Thanks for your reply, i will try to work on it, it could be interesting to add this feature in your plug-in. For me the only problem is what i describe, values of checboxes are not store directly via ajax request, but on submit button which reload the page, it's a constraint but at reloading we can have all the terms and we could order them.
@FabienArr Thanks for your feature request. There are some issues such as how to handle nested terms (whether to maintain the hierarchical structure and enable sorting), etc., but I think it would be great if it could be implemented.
I will consider the implementation, including whether it can be implemented.
@sectsect If think it's not the goal to maintain the hierarchical order structure because Wordpress doesn't keep it. Thanks for considering the request, i can help you, if you want.