isset( $raw['maxLength'] ) ? min( 65000, absint( $raw['maxLength'] ) ) : 0, 'rows' => isset( $raw['rows'] ) ? max( 2, min( 20, absint( $raw['rows'] ) ) ) : 4, ); } /** {@inheritdoc} */ public function sanitize_value( $raw, array $field ) { return is_scalar( $raw ) ? trim( sanitize_textarea_field( (string) $raw ) ) : ''; } /** {@inheritdoc} */ public function render_control( array $field, array $ctx ) { $attrs = array_merge( $this->base_attrs( $field, $ctx ), array( 'rows' => (int) $field['rows'], 'maxlength' => ! empty( $field['maxLength'] ) ? (int) $field['maxLength'] : false, ) ); $value = is_scalar( $ctx['value'] ) ? (string) $ctx['value'] : ''; return 'attrs( $attrs ) . '>' . esc_textarea( $value ) . ''; } }