packages/kirki-framework/core/src/Settings.php
final private function add_settings( $args = [] ) {

		// Get the classname we'll be using to create our setting(s).
		$classname = false;
		if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) {
			$classname = $this->setting_types[ $args['option_type'] ];
		}
		if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) {
			$args['type'] = 'default';
		}
		$classname = ! $classname ? $this->setting_types[ $args['type'] ] : $classname;

		// If settings are defined as an array, then we need to go through them
		// and call add_setting for each one of them separately.
		if ( isset( $args['settings'] ) && is_array( $args['settings'] ) ) {

			// Make sure defaults have been defined.
			if ( ! isset( $args['default'] ) || ! is_array( $args['default'] ) ) {
				$args['default'] = [];
			}
			foreach ( $args['settings'] as $key => $value ) {
				$default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : '';
				$this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] );
			}
		}
		$this->add_setting( $classname, $args['settings'], $args['default'], $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] );
	}
final private function add_settings( $args = [] ) {

		// Get the classname we'll be using to create our setting(s).
		$classname = false;
		if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) {
			$classname = $this->setting_types[ $args['option_type'] ];
		}
		if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) {
			$args['type'] = 'default';
		}
		$classname = ! $classname ? $this->setting_types[ $args['type'] ] : $classname;

		// If settings are defined as an array, then we need to go through them
		// and call add_setting for each one of them separately.
		if ( isset( $args['settings'] ) && is_array( $args['settings'] ) ) {

			// Make sure defaults have been defined.
			if ( ! isset( $args['default'] ) || ! is_array( $args['default'] ) ) {
				$args['default'] = [];
			}
			foreach ( $args['settings'] as $key => $value ) {
				$default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : '';
				$this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] );
			}
		}
		$this->add_setting( $classname, $args['settings'], $args['default'], $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] );
	}
final private function add_settings ( $ args = [ ] ) { // Get the classname we'll be using to create our setting(s). $ classname = false ; if ( isset ( $ args [ 'option_type' ] ) && array_key_exists ( $ args [ 'option_type' ] , $ this -> setting_types ) ) { $ classname = $ this -> setting_types [ $ args [ 'option_type' ] ] ; } if ( ! isset ( $ args [ 'type' ] ) || ! array_key_exists ( $ args [ 'type' ] , $ this -> setting_types ) ) { $ args [ 'type' ] = 'default' ; } $ classname = ! $ classname ? $ this -> setting_types [ $ args [ 'type' ] ] : $ classname ; // If settings are defined as an array, then we need to go through them // and call add_setting for each one of them separately. if ( isset ( $ args [ 'settings' ] ) && is_array ( $ args [ 'settings' ] ) ) { // Make sure defaults have been defined. if ( ! isset ( $ args [ 'default' ] ) || ! is_array ( $ args [ 'default' ] ) ) { $ args [ 'default' ] = [ ] ; } foreach ( $ args [ 'settings' ] as $ key => $ value ) { $ default = ( isset ( $ defaults [ $ key ] ) ) ? $ defaults [ $ key ] : '' ; $ this -> add_setting ( $ classname , $ value , $ default , $ args [ 'option_type' ] , $ args [ 'capability' ] , $ args [ 'transport' ] , $ args [ 'sanitize_callback' ] ) ; } } $ this -> add_setting ( $ classname , $ args [ 'settings' ] , $ args [ 'default' ] , $ args [ 'option_type' ] , $ args [ 'capability' ] , $ args [ 'transport' ] , $ args [ 'sanitize_callback' ] ) ; }
Adds the settings for this field.
If settings are defined as an array, then it goes through them
and calls the add_setting method.
If not an array, then it just calls add_setting

@access private
@param array $args The field definition as sanitized in Kirki\Core\Field.
Adds the settings for this field . If settings are defined as an array then it goes through them and calls the add_setting method . If not an array then it just calls add_setting