wc_attribute_orderby()
Get a product attributes orderby setting.
Hooks from the function
Returns
String.
Usage
wc_attribute_orderby( $name );
- $name(string) (required)
- Attribute name.
wc_attribute_orderby() wc attribute orderby code WC 10.4.3
function wc_attribute_orderby( $name ) {
$name = wc_attribute_taxonomy_slug( $name );
$id = wc_attribute_taxonomy_id_by_name( $name );
$taxonomies = wc_get_attribute_taxonomies();
return apply_filters( 'woocommerce_attribute_orderby', isset( $taxonomies[ 'id:' . $id ] ) ? $taxonomies[ 'id:' . $id ]->attribute_orderby : 'menu_order', $name );
}