class-kirki-field-kirki-generic.php (1166B)
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_Kirki_Generic' ) ) { 13 14 /** 15 * Field overrides. 16 */ 17 class Kirki_Field_Kirki_Generic extends Kirki_Field { 18 19 /** 20 * Sets the control type. 21 * 22 * @access protected 23 */ 24 protected function set_type() { 25 26 $this->type = 'kirki-generic'; 27 28 } 29 30 31 /** 32 * Sets the $choices 33 * 34 * @access protected 35 */ 36 protected function set_choices() { 37 38 if ( ! is_array( $this->choices ) ) { 39 $this->choices = array(); 40 } 41 if ( ! isset( $this->choices['element'] ) ) { 42 $this->choices['element'] = 'input'; 43 } 44 45 } 46 47 /** 48 * Sets the $sanitize_callback 49 * 50 * @access protected 51 */ 52 protected function set_sanitize_callback() { 53 54 // If a custom sanitize_callback has been defined, 55 // then we don't need to proceed any further. 56 if ( ! empty( $this->sanitize_callback ) ) { 57 return; 58 } 59 $this->sanitize_callback = 'wp_kses_post'; 60 61 } 62 } 63 }