Last active
March 4, 2018 15:08
-
-
Save psaikali/c30bec66921fa81674271fe895dcf29c to your computer and use it in GitHub Desktop.
Désactiver un champ ACF (lecture seule)
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 | |
// Article/tutoriel complet sur https://mosaika.fr/astuces-developpement-acf/ | |
// Documentation officielle https://www.advancedcustomfields.com/resources/acf-load_field/ | |
/** | |
* Désactiver un champ (lecture seule) | |
* Filtre : acf/load_field | |
*/ | |
function msk_acf_disable_field($field) { | |
$field['disabled'] = true; | |
//$field['readonly'] = true; | |
return $field; | |
} | |
add_filter('acf/load_field', 'msk_acf_disable_field'); | |
//add_filter('acf/load_field/name=annonce_prix_avec_commission', 'msk_acf_disable_field'); | |
//add_filter('acf/load_field/type=password', 'msk_acf_disable_field'); | |
//add_filter('acf/load_field/key=field_5a9af8d5250dd', 'msk_acf_disable_field'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment