woocommerce_sort_countries
Filters whether the list of countries is sorted by name.
Использование
add_filter( 'woocommerce_sort_countries', 'wp_kama_woocommerce_sort_countries_filter' );
/**
* Function for `woocommerce_sort_countries` filter-hook.
*
* @param bool $sort Whether to sort the countries.
*
* @return bool
*/
function wp_kama_woocommerce_sort_countries_filter( $sort ){
// filter...
return $sort;
}
- $sort(true|false)
- Whether to sort the countries.
По умолчанию: true
Список изменений
| С версии 2.0.0 | Введена. |
Где вызывается хук
woocommerce_sort_countries
woocommerce/includes/class-wc-countries.php 192
if ( apply_filters( 'woocommerce_sort_countries', true ) ) {