Automattic\WooCommerce\Internal\Logging
RemoteLogger::get_wc_version()
Get the current WooCommerce version reliably through a series of fallbacks
Метод класса: RemoteLogger{}
Хуков нет.
Возвращает
Строку
. The current WooCommerce version.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_wc_version();
Код RemoteLogger::get_wc_version() RemoteLogger::get wc version WC 9.7.1
private function get_wc_version() { if ( class_exists( '\Automattic\Jetpack\Constants' ) && method_exists( '\Automattic\Jetpack\Constants', 'get_constant' ) ) { $wc_version = \Automattic\Jetpack\Constants::get_constant( 'WC_VERSION' ); if ( $wc_version ) { return $wc_version; } } if ( function_exists( 'WC' ) && method_exists( WC(), 'version' ) ) { return WC()->version(); } if ( defined( 'WC_VERSION' ) ) { return WC_VERSION; } // Return null since none of the above worked. return null; }