AdvancedCustomFields / AdvancedCustomFields/acf
Cannot disable a datepicker field manipulating $field
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Hello everyone!
I was trying to disable some fields according the clean way suggested by the documentation:
function my_acf_prepare_field( $field ) {
if( $field['value'] ) {
$field['disabled'] = true;
}
return $field;
}
But I noticed that this code doesn't work (it's still possible to interact with the field) on the datepicker field (the same is true also datetime picker). I dug a bit into the code and I realized that, simply, the disabled attribute is not honored because there's not code that makes use of it.
Since it's quite trivial to solve, I'm about to submit a small pull request. :)
Have a nice day!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the datepicker and datetime picker fields render their controls, using the reported disabled-field behavior as the entry point. Confirm that fields disabled through the PHP hook can no longer be interacted with for both picker types, and verify the result against any relevant project checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100