Advanced Custom Fields | Categories.php | Checkboxes issue

Today i installed the Categories addon for the Advanced Custom Fields WordPress plugin and i discovered that when i was selecting “Checkboxes” as the Display type, it was returning the following error:

Warning: in_array() expects parameter 2 to be array, boolean given in …/categories.php on line 561

The temporary solution i found so far is the following: edit the categories.php file, go to line 561 and comment the following block of code:

if (in_array("none", $field['value'])) {
$is_selected = 'checked';
} else {
$is_selected = '';
}

I researched about this issue and on a forum someone was recommending to replace the following line

if (in_array("none", $field['value'])) {

with this one:

if( !is_array($field['value']) ){

The result i’m getting after doing this is all the categories are already checked when a new post is created, which, of course, it’s not the solution.

I will research more on this and update the post if i discover anything new.

No Comments Yet.

Leave a Reply