Home › Forums › Feature Requests › Set max length for editor › Reply To: Set max length for editor
Hi @rshmiraf
For WYSIWYG field, I believe you can do it like this:
add_filter('acf/validate_value/name=wysiwyg_field_name', 'my_acf_validate_value', 10, 4);
function my_acf_validate_value( $valid, $value, $field, $input ){
// bail early if value is already invalid
if( !$valid ) {
return $valid;
}
if( strlen($value) > 40 ) {
$valid = 'You can\'t enter more that 40 chars';
}
// return
return $valid;
}
If still no joy, could you please share the code you have?
Thanks 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.