Automattic\WooCommerce\Blocks\Assets

Api::get_file_version()protectedWC 1.0

Get the file modified time as a cache buster if we're in dev mode.

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

Хуков нет.

Возвращает

Строку. The cache buster value to use for the given file.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_file_version( $file );
$file(строка) (обязательный)
Local path to the file (relative to the plugin directory).

Код Api::get_file_version() WC 8.7.0

protected function get_file_version( $file ) {
	if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && file_exists( $this->package->get_path() . $file ) ) {
		return filemtime( $this->package->get_path( trim( $file, '/' ) ) );
	}
	return $this->wc_version;
}