You have to dig deep in the code, but back 7 years ago, they added the term_order
column to the relationships table, but there is not a good way to use it in core. In this ticket https://core.trac.www.ads-software.com/ticket/5857#comment:4 it shows simple code to enable the ordering of the terms assigned to a post. Could you add an option for that?
I don’t think the plugin would need to do the filter for get_the_terms
because in the wp_set_object_terms
function, there is this check for the sort parameter of the taxonomy:
$t = get_taxonomy($taxonomy);
if ( ! $append && isset($t->sort) && $t->sort )
where it loops through, incrementing term_order. But I haven’t tested it, so I’m not sure.
To be clear: I want to be able to determine the order of the terms per post, which is what that field is for. There are other plugins that allow me to change the order of the terms when listing them all (like days of the week), but those are adding a different term_order
column to the terms table.
-
This reply was modified 6 years, 4 months ago by Joy. Reason: clarification