WordPress at Your Fingertips
function is not described

WC_Legacy_Customer::filter_legacy_key() private WC 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.

{} It's a 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.

Code of WC_Legacy_Customer::filter_legacy_key() WC 5.7.1

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

	return $key;
}