Created
January 3, 2022 18:22
-
-
Save artikus11/1d2b2459474154fd27d4e01cb4391e7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Сортировка атрибутов в админке по алфавиту | |
* | |
* @param $attr | |
* | |
* @return array | |
* | |
* @testedwith WooCommerce 6.0 | |
* @author Artem Abramovich | |
*/ | |
function art_woocommerce_sorting_attributes_list( $attr ) { | |
return wp_list_sort( $attr, 'attribute_label', 'ASC' ); | |
} | |
add_filter( 'woocommerce_attribute_taxonomies', 'art_woocommerce_sorting_attributes_list' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No way. This is not required. I'm just sorting through what's already there. The woocommerce_attribute_taxonomies filter is triggered after all attributes are received. You don't need to receive anything