需要更新自定义字段值,如果它是空白错误如果它有任何值不想做任何事情
我只想在它是空代码时更新:
$custom_fields = get_post_custom($post_ID);//Current post id
$my_custom_field = $custom_fields['artist'];//key name
foreach ( $my_custom_field as $key => $value );
if(empty($value) or ($value == '')){
$artist_v = get_post_custom_values('artist', $post_ID);
update_post_meta($post_ID, 'artist', $parent_title, $artist_v);
}else{
//add_post_meta($post_ID, 'artist', $parent_title, true);
}