Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remplacer des variables/placeholders dans les champs ACF de type Message
// Article/tutoriel complet sur
// Documentation officielle
* Injecter des données dynamiques dans les champs de type message
* Filtre : acf/load_field
function msk_acf_variables_in_message_fields($field) {
$field['message'] = str_replace(
['%date_debut%', '%date_fin%'],
[date('Y') - 5, date('Y')],
return $field;
add_filter('acf/load_field/type=message', 'msk_acf_variables_in_message_fields');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.