ru-se.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

class-kirki-field-text.php (1002B)


      1 <?php
      2 /**
      3  * Override field methods
      4  *
      5  * @package     Kirki
      6  * @subpackage  Controls
      7  * @copyright   Copyright (c) 2016, Aristeides Stathopoulos
      8  * @license     http://opensource.org/licenses/https://opensource.org/licenses/MIT
      9  * @since       2.2.7
     10  */
     11 
     12 if ( ! class_exists( 'Kirki_Field_Text' ) ) {
     13 
     14 	/**
     15 	 * Field overrides.
     16 	 */
     17 	class Kirki_Field_Text extends Kirki_Field_Kirki_Generic {
     18 
     19 		/**
     20 		 * Sets the $choices
     21 		 *
     22 		 * @access protected
     23 		 */
     24 		protected function set_choices() {
     25 
     26 			if ( ! is_array( $this->choices ) ) {
     27 				$this->choices = array();
     28 			}
     29 			$this->choices['element'] = 'input';
     30 			$this->choices['type']    = 'text';
     31 
     32 		}
     33 
     34 		/**
     35 		 * Sets the $sanitize_callback
     36 		 *
     37 		 * @access protected
     38 		 */
     39 		protected function set_sanitize_callback() {
     40 
     41 			// If a custom sanitize_callback has been defined,
     42 			// then we don't need to proceed any further.
     43 			if ( ! empty( $this->sanitize_callback ) ) {
     44 				return;
     45 			}
     46 			$this->sanitize_callback = 'esc_textarea';
     47 
     48 		}
     49 	}
     50 }