Last active
February 3, 2021 19:10
-
-
Save smeric/65ab44a872cdf0e8ea56b497c0afab3b to your computer and use it in GitHub Desktop.
Pour répondre au commentaire de Christopher : https://sebastien-meric.com/configurer-simplement-click-and-collect-woocommerce/#comment-404
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( ' @ ', ' à ', $field ); // à 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