Conditional Logic: contains array throwing fatal error
-
Just been looking at the documentation on Conditional Logic in the ‘contains’ section, I’m trying to add a array of values for a set of checkbox fields, so the field is visible is any of the ids are set(via a checkbox)
the documentation says use the following:
'visible' => array('brand', 'contains', ['Apple'])
but it throws a fatal error when I use the following:
$meta_boxes[] = array( 'id' => 'he_subtitle', 'title' => __( 'HE Sub-Title', 'he_subtitle' ), 'post_types' => 'courses', 'priority' => 'low', 'autosave' => true, 'context' => 'side', 'visible' => array('course_type_select', 'contains', ['32','35']), 'fields' => array( // Course reference code array( 'name' => __( '' ), 'id' => "{$prefix}he_subtitle", 'desc' => __( 'HE sub-title (Year of entry)' ), 'type' => 'text', ), ), );
I also tried array() instead of [] which sorts the error but still doesn’t work, the only way i can get to to work is to use a single ID value.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Conditional Logic: contains array throwing fatal error’ is closed to new replies.