WordPress at Your Fingertips
function is not described

WooCommerce::call_function() public WC 4.4

Call a user function. This should be used to execute any non-idempotent function, especially those in the includes directory or provided by WordPress.

This method can be useful for unit tests, since functions called using this method can be easily mocked by using WC_Unit_Test_Case::register_legacy_proxy_function_mocks.

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

No Hooks.

Return

Mixed. The result from the function.

Usage

$WooCommerce = new WooCommerce();
$WooCommerce->call_function( $function_name, ...$parameters );
$function_name(string) (required)
The function to execute.
...$parameters(mixed) (required)
The parameters to pass to the function.

Changelog

Since 4.4 Introduced.

Code of WooCommerce::call_function() WC 5.6.0

public function call_function( $function_name, ...$parameters ) {
	return wc_get_container()->get( LegacyProxy::class )->call_function( $function_name, ...$parameters );
}