Created
January 31, 2016 04:14
-
-
Save haleeben/9d5cf157b443b43c1be0 to your computer and use it in GitHub Desktop.
Change a ACF field to readonly
This file contains hidden or 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
add_filter('acf/load_field/name=field_name', 'acf_readonly' ); | |
function acf_readonly( $field ) { | |
$field['readonly'] = 1; | |
return $field; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change
field_name
on line 1 to the name of your field