WC_Checkout::get_checkout_fields()publicWC 1.0

Get an array of checkout fields.

Method of the class: WC_Checkout{}

No Hooks.

Return

Array.

Usage

$WC_Checkout = new WC_Checkout();
$WC_Checkout->get_checkout_fields( $fieldset );
$fieldset(string)
to get.
Default: ''

WC_Checkout::get_checkout_fields() code WC 9.7.1

public function get_checkout_fields( $fieldset = '' ) {
	if ( is_null( $this->fields ) ) {
		$this->initialize_checkout_fields();
	}

	// If a fieldset is specified, return only the fields for that fieldset, or array if the field set does not exist.
	if ( $fieldset ) {
		return $this->fields[ $fieldset ] ?? array();
	}

	return $this->fields;
}