我最终得到了以下对我有用的结果:
function edu_acf_getValue($fieldname, $post_id = false){
if($post_id === false) $post_id = get_the_ID ();
if(($value = get_field($fieldname, $post_id)))
return $value;
$value = get_post_meta($post_id, $fieldname);
return $value[0];
}
function edu_acf_updateValue($fieldname, $value, $post_id){
$field_key = \'field_\' . uniqid();
update_post_meta($post_id, $fieldname, $value);
update_post_meta($post_id, \'_\'.$fieldname, $field_key);
update_field($field_key, $value, $post_id);
}