WC_API::get_rest_api_package_path()publicWC 3.7.0

Get the version of the REST API package being ran.

Метод класса: WC_API{}

Хуков нет.

Возвращает

Строку.

Использование

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

Список изменений

С версии 3.7.0 Введена.

Код WC_API::get_rest_api_package_path() 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();
}