Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sort Store taxonomy in alphabetical order
- add_filter( 'wcfm_vendor_store_taxomonies', function( $taxonomies, $vendor_id, $taxonomy ) {
- $terms = [];
- foreach( $taxonomies as $term_id => $termArray ) {
- $term = get_term( absint( $term_id ), $taxonomy );
- $terms[$term_id] = isset( $term->name ) ? $term->name : '';
- }
- asort($terms);
- foreach( $terms as $term_id => $term ) {
- $terms[$term_id] = $taxonomies[$term_id];
- }
- return $terms;
- }, 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement