Advanced Custom Fields in Wordpress - Show code & text if radio or checkbox selected or don't

Viewed 36

Looking for help on an ACF repeater for 2 optional pre-populated fields.

Creating a menu for a client that looks like this for a menu: [an example of 1 menu item line with all fields to visualize it]: (https://ibb.co/t2rq49K)

Repeater has 5 sub_fields as you can see in my PHP: PHP Code but you'll see in my PHP i haven't applied logic to the * or the gfm as i'd like that to be optional and pre-populated in the acf settings so if the user selects either one (keep them separate fields) it would add it to the correct place in the code.

At this point, there are see 3 fields i've put in (menu item name, description and price) that work great, however there are two other OPTIONAL items that I would like to have default values for:

<sup>*</sup>

and

<u>gym</u>

user would check a box/or radio button to add in the backend when adding a new menu item. Some items would have the * AND gfm, some would have maybe just one of the 2 and some may not have either one.

Anyone have any help with this for the PHP code and what i need to add for the acf settings?

0 Answers
Related