1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<?php
class CMB2_Type_Textarea extends CMB2_Type_Counter_Base {
public function render( $args = array() ) {
$args = empty( $args ) ? $this->args : $args;
$a = $this->parse_args( 'textarea', array(
'class' => 'cmb2_textarea',
'name' => $this->_name(),
'id' => $this->_id(),
'cols' => 60,
'rows' => 10,
'value' => $this->field->escaped_value( 'esc_textarea' ),
'desc' => $this->_desc( true ),
), $args );
$a = $this->maybe_update_attributes_for_char_counter( $a );
return $this->rendered(
sprintf( '<textarea%s>%s</textarea>%s', $this->concat_attrs( $a, array( 'desc', 'value' ) ), $a['value'], $a['desc'] )
);
}
}