Automattic\WooCommerce\Blocks
AssetsController::get_file_version()
Get the file modified time as a cache buster if we're in dev mode.
Метод класса: AssetsController{}
Хуков нет.
Возвращает
Строку
. The cache buster value to use for the given file.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_file_version( $file );
- $file(строка) (обязательный)
- Local path to the file.
Код AssetsController::get_file_version() AssetsController::get file version WC 9.8.5
protected function get_file_version( $file ) { if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( \Automattic\WooCommerce\Blocks\Package::get_path() . $file ) ) { return filemtime( \Automattic\WooCommerce\Blocks\Package::get_path() . $file ); } return $this->api->wc_version; }