62 public function validate( $name, $value, array $settings, array $options ) {
63 if ( !$this->allowEmptyWhenRequired && $value ===
'' &&
69 if ( isset( $settings[self::PARAM_MAX_BYTES] )
70 && strlen( $value ) > $settings[self::PARAM_MAX_BYTES]
73 'maxbytes' => $settings[self::PARAM_MAX_BYTES] ??
'',
74 'maxchars' => $settings[self::PARAM_MAX_CHARS] ??
'',
77 if ( isset( $settings[self::PARAM_MAX_CHARS] )
78 && mb_strlen( $value,
'UTF-8' ) > $settings[self::PARAM_MAX_CHARS]
81 'maxbytes' => $settings[self::PARAM_MAX_BYTES] ??
'',
82 'maxchars' => $settings[self::PARAM_MAX_CHARS] ??
'',