Home › Forums › Feature Requests › Change Label Conditionally › Reply To: Change Label Conditionally
The above is just an example.
So lets say I have 2 fields:
– format (radio buttons with two options [‘image’, ‘video’])
– content (textarea)
When the user (In the Admin) chooses format to be ‘image’ I would like the label for ‘content’ to be ‘Caption’.
When the user chooses format to be ‘video’ I would like the label for ‘content’ to be ‘Description’.
Sure, I could create two fields ‘caption’ and ‘description’ and set them conditionally based on ‘format’. The issue is then the user will have to copy their text and paste it in the next field. Which may not sound like a big deal, but when dealing with a repeater field where they have 20+ entries then it becomes one. Also I don’t want to have to add additional conditionals in my PHP code to retrieve the content.
I can understand that this may be an issue when trying to figure out the best way to do this in the GUI, but my team and I don’t use the GUI. We build out all the fields using PHP. So for now I am just hoping that this can be done with PHP.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.