This commit is contained in:
Nabil Kadimi
2018-05-26 15:39:02 +00:00
parent d9bdaa20c8
commit b13a9c4db4
3 changed files with 25 additions and 6 deletions

View File

@@ -82,9 +82,7 @@ abstract class SP_Custom_Post {
public function get_terms_sorted_by_sp_order( $taxonomy ) {
$terms = get_the_terms( $this->ID, $taxonomy );
if ( $terms ) {
usort( $terms, function( $a, $b ) {
return get_term_meta( $a->term_id, 'sp_order', true ) > get_term_meta( $b->term_id, 'sp_order', true );
} );
usort( $terms, 'sp_sort_terms' );
}
return $terms;
}