docs/files/class-my-theme-kirki.php
public static function add_field( $config_id, $args ) {

		// if Kirki exists, use it.
		if ( class_exists( 'Kirki' ) ) {
			Kirki::add_field( $config_id, $args );
			return;
		}

		// Kirki was not located, so we'll need to add our fields here.
		// Check that the "settings" & "type" arguments have been defined.
		if ( isset( $args['settings'] ) && isset( $args['type'] ) ) {

			// Make sure we add the config_id to the field itself.
			// This will make it easier to get the value when generating the CSS later.
			if ( ! isset( $args['kirki_config'] ) ) {
				$args['kirki_config'] = $config_id;
			}
			self::$fields[ $args['settings'] ] = $args;
		}
	}
public static function add_field( $config_id, $args ) {

		// if Kirki exists, use it.
		if ( class_exists( 'Kirki' ) ) {
			Kirki::add_field( $config_id, $args );
			return;
		}

		// Kirki was not located, so we'll need to add our fields here.
		// Check that the "settings" & "type" arguments have been defined.
		if ( isset( $args['settings'] ) && isset( $args['type'] ) ) {

			// Make sure we add the config_id to the field itself.
			// This will make it easier to get the value when generating the CSS later.
			if ( ! isset( $args['kirki_config'] ) ) {
				$args['kirki_config'] = $config_id;
			}
			self::$fields[ $args['settings'] ] = $args;
		}
	}
public static function add_field ( $ config_id , $ args ) { // if Kirki exists, use it. if ( class_exists ( 'Kirki' ) ) { Kirki :: add_field ( $ config_id , $ args ) ; return ; } // Kirki was not located, so we'll need to add our fields here. // Check that the "settings" & "type" arguments have been defined. if ( isset ( $ args [ 'settings' ] ) && isset ( $ args [ 'type' ] ) ) { // Make sure we add the config_id to the field itself. // This will make it easier to get the value when generating the CSS later. if ( ! isset ( $ args [ 'kirki_config' ] ) ) { $ args [ 'kirki_config' ] = $ config_id ; } self :: $ fields [ $ args [ 'settings' ] ] = $ args ; } }
Create a new field

@param string $config_id The configuration ID.
@param array  $args      The field's arguments.
@return null
Create a new field