'', 'label' => '', 'help' => '', 'description' => '', 'required' => null, 'transport' => 'refresh', 'type' => 'text', 'option_type' => 'theme_mod', 'option_name' => '', 'section' => 'title_tagline', 'settings' => '', 'priority' => 10, 'choices' => array(), 'output' => array(), 'sanitize_callback' => '', 'js_vars' => array(), 'id' => '', 'capability' => 'edit_theme_options', 'variables' => null, ); /** * Field type has to run before the others to accomodate older implementations * If we don't do this then kirki/config filters won't work properly. */ $field['option_type'] = self::sanitize_type( $field ); $field['option_name'] = self::sanitize_option_name( $field ); /** * Merge defined args with defaults */ $field = wp_parse_args( $field, $defaults ); /** * Strip all HTML from help messages */ $field['help'] = wp_strip_all_tags( $field['help'] ); /** * If the 'required' argument is set then we'll need to auto-calculate things. * Set 'active_callback' to 'Kirki_Active_Callback::evaluate'. ALl extra calculations will be handled there. */ if ( isset( $field['required'] ) ) { $field['active_callback'] = array( 'Kirki_Active_Callback', 'evaluate' ); } elseif ( ! isset( $field['active_callback'] ) ) { $field['active_callback'] = '__return_true'; } /** * Get the right control type */ $field['type'] = self::sanitize_control_type( $field ); /** * Sanitize the settings argument */ $field['settings'] = self::sanitize_settings( $field ); /** * Sanitize the choices argument */ $field['choices'] = ( isset( $field['choices'] ) ) ? $field['choices'] : array(); /** * Sanitize the output argument */ $field['output'] = isset( $field['output'] ) ? $field['output'] : array(); /** * Sanitize the sanitize_callback argument */ $field['sanitize_callback'] = self::sanitize_callback( $field ); /** * Sanitize the id argument */ $field['id'] = self::sanitize_id( $field ); /** * Sanitize the capability argument */ $field['capability'] = self::sanitize_capability( $field ); /** * Sanitize the variables argument */ $field['variables'] = ( isset( $field['variables'] ) && is_array( $field['variables'] ) ) ? $field['variables'] : null; /** * Make sure the "multiple" argument is properly formatted for