WC_Data_Store::__call( string $method, mixed $parameters )

Data stores can define additional functions (for example, coupons have some helper methods for increasing or decreasing usage). This passes through to the instance if that function exists.


Description Description


Parameters Parameters

$method

(Required) Method.

$parameters

(Required) Parameters.


Top ↑

Return Return

(mixed)


Top ↑

Source Source

File: includes/class-wc-data-store.php

	public function __call( $method, $parameters ) {
		if ( is_callable( array( $this->instance, $method ) ) ) {
			$object     = array_shift( $parameters );
			$parameters = array_merge( array( &$object ), $parameters );
			return $this->instance->$method( ...$parameters );
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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