Home Forums Backend Issues (wp-admin) default image field attachment Reply To: default image field attachment

  • Hi,

    you can use the acf/prepare_field filter for that.

    In the function, you first check if the value is null. Only a newly create post will have null, if it’s a saved post that has no value, it’s an empty string.

    add_filter('acf/prepare_field/type=image', 'acf_use_default_image');
    function acf_use_default_image($field) {
        if ($field['value'] === null) {
            $field['value'] = 5; // attachment id
        return $field;

    Cheers 🤗