I need help to resolve this issue as I am not a programmer.
I have a custom field (select or checkbox) called “colors” and 3 values (red, green, black).
I want to display a custom icon depending on the value chosen.
I had this piece of code that I worked in earlier versions:
You say select or checkbox. These 2 field types can save data in 2 different ways. Please be specific as to which field type you are using and also if you have any options selected such as multiple values.
Also, please checkout the select / checkbox documentation. I have a feeling you find some example code which will demonstrate how to use the in_array function you need.
Yes, sorry for the confusion of my question.
I thought it served the same code for both, regardless of the multiple-choice factor.
But his indication was perfect to find the code I needed.
It had been several times and select the checkbox documentation but I could not understand.
Now it works perfect for single or multiple value select and checkbox.
It’s official! These brilliant minds (@tessak22 and @zgordon) are creating an entire course on ACF Blocks! Interested in Gutenberg but enjoy the comfortable recliner that is PHP? This course is for you! Pre-sale on now! 🔥🔥🔥 https://t.co/ifMzctgsN8