WordPress at Your Fingertips
function is not described

WC_API::get_rest_api_package_path() public WC 3.7.0

Get the version of the REST API package being ran.

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

Code of WC_API::get_rest_api_package_path() WC 5.9.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();
}