I’m having issues adding checkbox fields with hard-coded choices (in admin).
Every time I add a checkbox and adding the choices in admin, I’m getting this error:
array_map(): Argument #2 ($array) must be of type array, int given
Checkboxes added using taxonomy field are fine.
In:
/advanced-custom-fields-pro/includes/fields/class-acf-field-checkbox.php:247
This is the code:
$args[‘disabled’] = array_map( ‘esc_attr’, $args[‘disabled’] );
($args[‘disabled’] is 0)
Here’s the field.:
{
“key”: “field_65e14ce0816cf”,
“label”: “Charts Reporting To”,
“name”: “charts_reporting_to”,
“aria-label”: “”,
“type”: “checkbox”,
“instructions”: “”,
“required”: 0,
“conditional_logic”: 0,
“wrapper”: {
“width”: “”,
“class”: “”,
“id”: “”
},
“disabled”: 0,
“relevanssi_exclude”: 0,
“choices”: {
“Country Aircheck”: “Country Aircheck”,
“Music Row”: “Music Row”,
“AMA”: “AMA”,
“Roots Music Report”: “Roots Music Report”,
“Bluegrass Unlimited Survey”: “Bluegrass Unlimited Survey”,
“Bluegrass Today Bluegrass”: “Bluegrass Today Bluegrass”,
“Bluegrass Today Grassicana”: “Bluegrass Today Grassicana”,
“Bluegrass Today Gospel”: “Bluegrass Today Gospel”,
“Singing News”: “Singing News”,
“Singing News Bluegrass”: “Singing News Bluegrass”
},
“default_value”: [],
“return_format”: “value”,
“allow_custom”: 1,
“save_custom”: 0,
“layout”: “vertical”,
“toggle”: 0,
“custom_choice_button_text”: “Add new choice”
},
I noticed all ACF fields have disabled set to zero.
Any help is appreciated.
You must be logged in to reply to this topic.
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.