Layout builder – translate date abbreviation

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_filter( ‘facetwp_builder_item_value’, function( $value, $item ) {
if ( ‘actu-date’ == $item[‘settings’][‘name’] ) {
$find = [ ‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’, ‘Jul’, ‘Aug’, ‘Sep’, ‘Opt’, ‘Nov’, ‘Dec’ ];
$replace = [ ‘janv’, ‘févr’, ‘mars’, ‘avril’, ‘mai’, ‘juin’, ‘juil’, ‘août’, ‘sept’, ‘oct’, ‘nov’, ‘déc’ ];
return str_replace( $find, $replace, $value );
}
return $value;
}, 10, 2 );
{{/gist}}