Same name and namespace in other branches
  1. 6.x includes/common.inc \_drupal_flush_css_js()
  2. 7.x includes/common.inc \_drupal_flush_css_js()
  3. 8.9.x core/includes/common.inc \_drupal_flush_css_js()
  4. 9 core/includes/common.inc \_drupal_flush_css_js()

Changes the dummy query string added to all CSS and JavaScript files.

Changing the dummy query string appended to CSS and JavaScript files forces all browsers to reload fresh files.

Deprecated

in drupal:10.2.0 and is removed from drupal:11.0.0. Use Use \Drupal\Core\Asset\AssetQueryStringInterface::reset() instead.

See also

https://www.drupal.org/node/3358337

1 call to _drupal_flush_css_js()
LegacyAssetTest::testDeprecatedDrupalFlushCssJs in core/tests/Drupal/KernelTests/Core/Asset/LegacyAssetTest.php
Tests the deprecation.

File

core/includes/common.inc, line 507
Common functions that many Drupal modules will need to reference.

Code

function _drupal_flush_css_js() {
  @trigger_error('_drupal_flush_css_js is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Asset\\AssetQueryStringInterface::reset() instead. See https://www.drupal.org/node/3358337', E_USER_DEPRECATED);
  \Drupal::service('asset.query_string')
    ->reset();
}