Support

Account

Home Forums Backend Issues (wp-admin) Is it actually possible to populate custom fields via the REST API? Reply To: Is it actually possible to populate custom fields via the REST API?

  • For me this was caused by an issue with the ACF screen that was used during the REST requests missing the attachment key. Filtering the screen and adding for media posts worked for me

    add_filter(‘acf/location/screen’, function($screen) {
    if ($screen[‘post_id’]) {
    $post = get_post($screen[‘post_id’]);
    if($post && $post->post_type == ‘attachment’) {
    $screen[‘attachment’] = $screen[‘post_id’];
    }
    }
    return $screen;
    }, 10, 1);