Checkbox::prepare()
Description #
Prepare field.
Source #
File: lib/form/class-checkbox.php
protected function prepare() { $this->args = wp_parse_args( $this->args, array( 'label' => __( 'AnsPress Checkbox Field', 'anspress-question-answer' ), ) ); // Call parent prepare(). parent::prepare(); // Make sure checkbox value are sanitized. if ( $this->get( 'options' ) ) { $this->sanitize_cb = array_merge( array( 'array_remove_empty', 'text_field' ), $this->sanitize_cb ); } else { $this->sanitize_cb = array_merge( array( 'boolean' ), $this->sanitize_cb ); } }
Expand full source code Collapse full source code View on GitHub: lib/form/class-checkbox.php:38
Add your comment