Skip to content

Instantly share code, notes, and snippets.

@hmowais
Created October 18, 2019 05:02
Show Gist options
  • Save hmowais/f2810bc78ace025f48ab3bc3e36a8138 to your computer and use it in GitHub Desktop.
Save hmowais/f2810bc78ace025f48ab3bc3e36a8138 to your computer and use it in GitHub Desktop.
Show Woocommerce Product Variation Label in Dropdown list
add_filter( 'woocommerce_dropdown_variation_attribute_options_args', 'dropdown_label', 10 );
function dropdown_label( $args ) {
$var_tax = wc_attribute_label( $args['attribute']);
$args['show_option_none'] = apply_filters( 'the_title', $var_tax );
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment