📅  最后修改于: 2022-03-11 14:57:55.208000             🧑  作者: Mango
add_filter( 'woocommerce_dropdown_variation_attribute_options_html', 'filter_dropdown_option_html', 12, 2 );
function filter_dropdown_option_html( $html, $args ) {
$show_option_none_text = $args['show_option_none'] ? $args['show_option_none'] : __( 'Choose an option', 'woocommerce' );
$show_option_none_text = esc_html( $show_option_none_text );
$html = str_replace($show_option_none_text, '', $html);
return $html;
}