You are here

function hook_advagg_get_css_file_contents_alter in Advanced CSS/JS Aggregation 7.2

Allow other modules to modify this files contents.

Parameters

string $contents: Raw file data.

string $file: Filename.

array $aggregate_settings: An associative array of hooks and settings used.

See also

advagg_get_css_aggregate_contents()

advagg_css_compress_advagg_get_css_aggregate_contents_alter()

Related topics

2 functions implement hook_advagg_get_css_file_contents_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

advagg_font_advagg_get_css_file_contents_alter in advagg_font/advagg_font.advagg.inc
Implements hook_advagg_get_css_file_contents_alter().
advagg_mod_advagg_get_css_file_contents_alter in advagg_mod/advagg_mod.advagg.inc
Implements hook_advagg_get_css_file_contents_alter().
3 invocations of hook_advagg_get_css_file_contents_alter()
advagg_get_css_aggregate_contents in ./advagg.missing.inc
Given a list of files, grab their contents and glue it into one big string.
advagg_mod_find_critical_css_file in advagg_mod/advagg_mod.module
Try to find the critical css file.
advagg_mod_inline_css in advagg_mod/advagg_mod.module
Transforms all CSS files into inline CSS.

File

./advagg.api.php, line 253
Hooks provided by the AdvAgg module.

Code

function hook_advagg_get_css_file_contents_alter(&$contents, $file, array $aggregate_settings) {
  if (empty($aggregate_settings['variables']['advagg_css_compressor'])) {
    return;
  }
  if ($aggregate_settings['variables']['advagg_css_compressor'] == 2) {
    advagg_css_compress_yui_cssmin($contents);
  }
}