WC_API::get_rest_api_package_path()publicWC 3.7.0

Get the version of the REST API package being ran.

Method of the class: WC_API{}

No Hooks.

Return

String.

Usage

$WC_API = new WC_API();
$WC_API->get_rest_api_package_path();

Changelog

Since 3.7.0 Introduced.

WC_API::get_rest_api_package_path() code WC 8.7.0

public function get_rest_api_package_path() {
	if ( ! $this->is_rest_api_loaded() ) {
		return null;
	}
	if ( method_exists( \Automattic\WooCommerce\RestApi\Server::class, 'get_path' ) ) {
		// We are loading API from included version.
		return \Automattic\WooCommerce\RestApi\Server::get_path();
	}
	// We are loading API from external plugin.
	return \Automattic\WooCommerce\RestApi\Package::get_path();
}