hijiriworld / intuitive-custom-post-order

WordPress Plugin: Intuitive Custom Post Order
68 stars 34 forks source link

orderby term_order doesn't work #37

Open orangutangle opened 4 years ago

orangutangle commented 4 years ago

There is an error in hicpo_get_terms_orderby which prevents the get_terms orderby override from being applied:

$tags = $this->get_hicpo_options_tags();

if( !isset( $args['taxonomy'] ) ) return $orderby;

$taxonomy = $args['taxonomy'];
if ( !in_array( $taxonomy, $tags ) ) return $orderby;

Because $taxonomy is an array, the in_array check always fails and the orderby is never modified to 't.term_order'.

The solution is to change the line to:

$taxonomy = $args['taxonomy'][0];