Home › Forums › General Issues › Undefined index: key
Hello! I get next notice while using ACF: Undefined index: key on line 915 in file\www\wp-content\plugins\advanced-custom-fields\core\api.php
This notice appeares on front and back end pages where I’m using conditional logic in custom fields. Here is my code for this fields:
register_field_group(array (
'id' => 'acf_video',
'title' => 'Video',
'fields' => array (
array (
'layout' => 'horizontal',
'choices' => array (
'youtube' => 'Youtube',
'vimeo' => 'Vimeo',
'none' => 'None',
),
'default_value' => 'none',
'key' => 'field_51dcec694fdf79',
'label' => __('Video type','EPB'),
'name' => 'video_type',
'type' => 'radio',
),
array (
'default_value' => '',
'formatting' => 'html',
'key' => 'field_51dcedb44fdfa1',
'label' => __('Video ID','EPB'),
'name' => 'video_id',
'type' => 'text',
'conditional_logic' => array (
'status' => 1,
'rules' => array (
array (
'field' => 'field_51dcec694fdf79',
'operator' => '==',
'value' => 'youtube',
),
array (
'field' => 'field_51dcec694fdf79',
'operator' => '==',
'value' => 'vimeo',
),
),
'allorany' => 'any',
),
),
array (
'conditional_logic' => array (
'status' => 1,
'rules' => array (
array (
'operator' => '==',
'value' => 'none',
),
),
'allorany' => 'all',
),
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'gg_slider',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
Will be appreciate for any help. Thanks.
Problem solved. Conditional logic is not a field of field group.
The topic ‘Undefined index: key’ is closed to new replies.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.