Notice: Undefined index: key in wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php on line 349
Notice: Undefined index: key in wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php on line 350
Notice: Undefined index: key in wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php on line 349
Notice: Undefined index: key in wp-content/plugins/advanced-custom-fields-pro/includes/acf-field-functions.php on line 350
<?php | |
# line 350 | |
/** | |
* Hack to fix 'Undefined index: key' bug | |
* | |
* @author Gary Swift | |
* | |
* @link https://support.advancedcustomfields.com/forums/topic/acf-field-functions-php349-undefined-index-key/ | |
*/ | |
if ( isset( $parent['key'] ) && isset( $parent['ID'] ) ) {//new | |
// Check local fields first. | |
if( acf_have_local_fields($parent['key']) ) { | |
$raw_fields = acf_get_local_fields( $parent['key'] ); | |
foreach( $raw_fields as $raw_field ) { | |
$fields[] = acf_get_field( $raw_field['key'] ); | |
} | |
// Then check database. | |
} else { | |
if ( isset( $parent['ID'] ) ) {//new | |
$raw_fields = acf_get_raw_fields( $parent['ID'] ); | |
foreach( $raw_fields as $raw_field ) { | |
$fields[] = acf_get_field( $raw_field['ID'] ); | |
} | |
}//new | |
} | |
}//new |