Textarea()
Description #
The Textarea type field object.
Source #
File: lib/form/class-textarea.php
class Textarea extends Field {
/**
* The field type.
*
* @var string
*/
public $type = 'textarea';
/**
* Prepare field.
*
* @return void
*/
protected function prepare() {
$this->args = wp_parse_args(
$this->args,
array(
'label' => __( 'AnsPress Textarea Field', 'anspress-question-answer' ),
'attr' => array(
'rows' => 8,
),
)
);
// Call parent prepare().
parent::prepare();
$this->sanitize_cb = array_merge( array( 'textarea_field' ), $this->sanitize_cb );
}
/**
* Field markup.
*
* @return void
*/
public function field_markup() {
parent::field_markup();
$this->add_html( '<textarea' . $this->common_attr() . $this->custom_attr() . '>' );
$this->add_html( esc_textarea( $this->value() ) );
$this->add_html( '</textarea>' );
/** This action is documented in lib/form/class-input.php */
do_action_ref_array( 'ap_after_field_markup', array( &$this ) );
}
}
Expand full source code Collapse full source code View on GitHub: lib/form/class-textarea.php:27
Add your comment