WC_Checkout::get_checkout_fields
Get an array of checkout fields.
Method of the class: WC_Checkout{}
No Hooks.
Returns
Array.
Usage
$WC_Checkout = new WC_Checkout(); $WC_Checkout->get_checkout_fields( $fieldset );
- $fieldset(string)
- to get.
Default:''
WC_Checkout::get_checkout_fields() WC Checkout::get checkout fields code WC 10.6.2
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;
}