function hook_advagg_modify_js_pre_render_alter


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 advagg.api.php hook_advagg_modify_js_pre_render_alter(&$children, &$elements)
cle7 advagg.api.php hook_advagg_modify_js_pre_render_alter(&$children, &$elements)
elmsmedia7 advagg.api.php hook_advagg_modify_js_pre_render_alter(&$children, &$elements)
icor7 advagg.api.php hook_advagg_modify_js_pre_render_alter(&$children, &$elements)
meedjum_blog7 advagg.api.php hook_advagg_modify_js_pre_render_alter(&$children, &$elements)
mooc7 advagg.api.php hook_advagg_modify_js_pre_render_alter(&$children, &$elements)

Allow other modules to modify $children & $elements before they are rendered.


array $children: An array of children elements.

array $elements: A render array containing:

  • #items: The JavaScript items as returned by drupal_add_js() and altered by drupal_get_js().
  • #group_callback: A function to call to group #items. Following this function, #aggregate_callback is called to aggregate items within the same group into a single file.
  • #aggregate_callback: A function to call to aggregate the items within the groups arranged by the #group_callback function.

See also



Related topics

2 functions implement hook_advagg_modify_js_pre_render_alter()

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

advagg_js_compress_advagg_modify_js_pre_render_alter in sites/all/modules/ulmus/advagg/advagg_js_compress/advagg_js_compress.module
Implements hook_advagg_modify_js_pre_render_alter().
advagg_mod_advagg_modify_js_pre_render_alter in sites/all/modules/ulmus/advagg/advagg_mod/advagg_mod.module
Implements hook_advagg_modify_js_pre_render_alter().
1 invocation of hook_advagg_modify_js_pre_render_alter()
advagg_modify_js_pre_render in sites/all/modules/ulmus/advagg/advagg.module
Callback for pre_render so elements can be modified before they are rendered.


sites/all/modules/ulmus/advagg/advagg.api.php, line 495
Hooks provided by the AdvAgg module.


function hook_advagg_modify_js_pre_render_alter(&$children, &$elements) {
  // Get variables.
  $aggregate_settings['variables']['advagg_js_compressor'] = variable_get('advagg_js_inline_compressor', ADVAGG_JS_INLINE_COMPRESSOR);
  $aggregate_settings['variables']['advagg_js_max_compress_ratio'] = variable_get('advagg_js_max_compress_ratio', ADVAGG_JS_MAX_COMPRESS_RATIO);

  // Do nothing if the compressor is disabled.
  if (empty($aggregate_settings['variables']['advagg_js_compressor'])) {

  // Do nothing if the page is not cacheable and inline compress if not
  // cacheable is not checked.
  if (!variable_get('advagg_js_inline_compress_if_not_cacheable', ADVAGG_JS_INLINE_COMPRESS_IF_NOT_CACHEABLE) && !drupal_page_is_cacheable()) {

  // Compress any inline JS.
  module_load_include('inc', 'advagg_js_compress', 'advagg_js_compress.advagg');
  foreach ($children as $key => &$values) {
    if (!empty($values['#value'])) {
      $contents = $values['#value'];
      $filename = drupal_hash_base64($contents);
      advagg_js_compress_prep($contents, $filename, $aggregate_settings, FALSE);
      $values['#value'] = $contents;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.