WordPress at Your Fingertips
function is not described

WC_Checkout::maybe_skip_fieldset() protected WC 3.0.0

See if a fieldset should be skipped.

{} It's a method of the class: WC_Checkout{}

No Hooks.

Return

true|false.

Usage

// protected - for code of main (parent) or child class
$result = $this->maybe_skip_fieldset( $fieldset_key, $data );
$fieldset_key(string) (required)
Fieldset key.
$data(array) (required)
Posted data.

Changelog

Since 3.0.0 Introduced.

Code of WC_Checkout::maybe_skip_fieldset() WC 5.9.0

protected function maybe_skip_fieldset( $fieldset_key, $data ) {
	if ( 'shipping' === $fieldset_key && ( ! $data['ship_to_different_address'] || ! WC()->cart->needs_shipping_address() ) ) {
		return true;
	}

	if ( 'account' === $fieldset_key && ( is_user_logged_in() || ( ! $this->is_registration_required() && empty( $data['createaccount'] ) ) ) ) {
		return true;
	}

	return false;
}