WC_Legacy_Customer::__get( string $key )

__get function.


Description Description


Parameters Parameters

$key

(Required)


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/legacy/class-wc-legacy-customer.php

	public function __get( $key ) {
		wc_doing_it_wrong( $key, 'Customer properties should not be accessed directly.', '3.0' );
		$key = $this->filter_legacy_key( $key );
		if ( in_array( $key, array( 'country', 'state', 'postcode', 'city', 'address_1', 'address', 'address_2' ) ) ) {
			$key = 'billing_' . $key;
		}
		return is_callable( array( $this, "get_{$key}" ) ) ? $this->{"get_{$key}"}() : '';
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.