I have a custom field group for custom post attachments using the "file" type. This filed type is now requiring a full url when previously it would allow for a relative path. We are unable to make updates to the parent post without adding a full url.
Because we are using a dev version of the site on a subdomain, adding the full url here will cause problems when the site is pushed to the live environment. How an I disable the full url validation on this field?
Hello,
You can edit the custom URL field setting, change option "Field type" to "Single line", for example:
Dashboard-> Toolset-> Custom Fields
find and edit that custom URL field, change the option "Field type" to "Single line", and test again.
Thanks, this does work, and seems like a good temporary work around. However, this leaves other users without the file upload dialog for adding attachements to other posts like this one.
You can also edit the custom URL field, disable option "Validation": URL, see screenshot Validation-URL.JPG
The field type I am using is "File". I do have Validation:Required unchecked, but it still validates for a full url as the file path. Unfortunately there is no other option for the field type that I see.
Yes, you are right, there isn't other option for the file field type.
There is a workaround by using custom codes, for example if your custom file field slug is "my-file" with filter hook "toolset_filter_field_definition_array", you can add below codes into your theme/functions.php:
add_filter('toolset_filter_field_definition_array', function($config, $filter_validation){
if($config['id'] == 'my-file'){
unset($config['data']['validate']);
}
return $config;
}, 11, 2);
Please replace "my-file" with your custom file field slug, and test again.