Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
// Ce filtre s'applique à tous les champs select rendus par WooCommerce, mais on se cantonne à un
// chercher/remplacer sur celui qui nous interesse : local_pickup_time_select
//
// @see https://sebastien-meric.com/configurer-simplement-click-and-collect-woocommerce/#comment-404
// @see https://plugins.trac.wordpress.org/browser/woocommerce-local-pickup-time-select/trunk/public/class-local-pickup-time.php#L560
// @see https://plugins.trac.wordpress.org/browser/woocommerce-local-pickup-time-select/trunk/public/class-local-pickup-time.php#L579
add_filter( "woocommerce_form_field_select", 'my_filter_woocommerce_form_field_type_select', 10, 4 );
function my_filter_woocommerce_form_field_type_select( $field, $key, $args, $value ){
if ( 'local_pickup_time_select' === $key ){
$field = str_replace( ' @ ', ' &agrave; ', $field ); // &agrave; est l'entité HTML qui correspond au "à"
}
return $field;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment