Automattic\WooCommerce\Internal\Admin
WCAdminAssets::get_file_version
Gets the file modified time as a cache buster if we're in dev mode, or the asset version (file content hash) if exists, or the WooCommerce version.
Метод класса: WCAdminAssets{}
Хуков нет.
Возвращает
string. The cache buster value to use for the given file.
Использование
$result = WCAdminAssets::get_file_version( $ext, $asset_version );
- $ext(строка) (обязательный)
- File extension.
- $asset_version(строка|null)
- The version from the asset file.
По умолчанию:null
Код WCAdminAssets::get_file_version() WCAdminAssets::get file version WC 11.1.2
public static function get_file_version( $ext, $asset_version = null ) {
if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
return filemtime( WC_ADMIN_ABSPATH . self::get_path( $ext ) );
}
if ( ! empty( $asset_version ) ) {
return $asset_version;
}
return WC_VERSION;
}