Skip to content

Instantly share code, notes, and snippets.

@psaikali
Created March 4, 2018 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psaikali/442b1e27e63668e1d1e7d9dff3db49ae to your computer and use it in GitHub Desktop.
Save psaikali/442b1e27e63668e1d1e7d9dff3db49ae to your computer and use it in GitHub Desktop.
Ne pas enregistrer la valeur d'un champ ACF
<?php
// Article/tutoriel complet sur https://mosaika.fr/astuces-developpement-acf/
// Documentation officielle https://www.advancedcustomfields.com/resources/acf-update_value/
/**
* Comparer la valeur de 2 champs pour accepter/refuser leur validation
* Filtre : acf/update_value
*/
function msk_acf_do_not_save_field_value($value, $post_id, $field) {
return null;
}
//add_filter('acf/update_value/type=password', 'msk_acf_do_not_save_field_value', 10, 3);
add_filter('acf/update_value/name=annonceur_mot_de_passe', 'msk_acf_do_not_save_field_value', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment