false, 'instructions' => '', 'type' => 'acfe_dynamic_render', 'required' => false, 'name' => 'acfe_field_data', 'key' => 'acfe_field_data', 'value' => $id, ), true); } function render_field($field){ $id = $field['value']; // validate if(!$id) return; // Field $field = acf_get_field($id); $field = array_map(function($value){ if(is_array($value)) return $value; return esc_html($value); }, $field); $field_debug = $field ? '
' . print_r($field, true) . '' : '
' . __('Field data unavailable', 'acfe') . '';
// Post
$post = get_post($id, ARRAY_A);
$post = array_map(function($value){
if(is_array($value)) return $value;
return esc_html($value);
}, $post);
$post_debug = $post ? '' . print_r($post, true) . '' : '
' . __('Post object unavailable', 'acfe') . '';
// title
$title = __('Field Data', 'acf');
// field label
if($field){
$label = acf_maybe_get($field, 'label');
$name = acf_maybe_get($field, 'name');
$title = $label ? $label : $name;
}
?>