Skip Navigation

[Resolved] Split: Is image validation like ACF with Toolset types image field

This support ticket is created 6 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Beda 6 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1134987

The user is looking to have custom field image validation for custom image field created using Types.

The validation options should be just like ACF - please check following image:
=> hidden link

Minimum and Maximum
- wdith
- height
- file size

Allowed file types

#1136650

That's not possible in Toolset Types but it's possible in Toolset Forms using the API:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
If you require help with that, please open a new Ticket (How to) and our Supporters will help you.

As for the feature you mention itself, I have this Feature Request which you can upvote (and share with your friends/other users of Toolset so they can upvote too).
https://toolset.com/feature-request/allow-image-validation-in-toolset-types-image-field/
https://toolset.com/feature-request/?wpv_post_search=Allow+Image+validation+in+Toolset+Types+Image+Field&wpv_sort_orderby=post_date&wpv_sort_orderby_as=string&wpv_view_count=686737

#1136987

Cred is for frontend form as far as I understand. I need validation for the backend admin custom fields. Can that be done?

#1137437

No, as stated here it is not possible:
https://toolset.com/forums/topic/split-is-image-validation-like-acf-with-toolset-types-image-field/#post-1136650

There is no official API to validate the Field in the backend, however, you can hook into save_post() action of WordPress and run a custom validation on the attachment size or type added to the custom Types Image Field
But we have no API for this, at the moment.