WC_Legacy_Customer::filter_legacy_key()privateWC 3.0.0

Address and shipping_address are aliased, so we want to get the 'real' key name. For all other keys, we can just return it.

Method of the class: WC_Legacy_Customer{}

No Hooks.

Return

String.

Usage

// private - for code of main (parent) class only
$result = $this->filter_legacy_key( $key );
$key(string) (required)
-

Changelog

Since 3.0.0 Introduced.

WC_Legacy_Customer::filter_legacy_key() code WC 8.7.0

private function filter_legacy_key( $key ) {
	if ( 'address' === $key ) {
		$key = 'address_1';
	}
	if ( 'shipping_address' === $key ) {
		$key = 'shipping_address_1';
	}

	return $key;
}