drupal_add_html_head

Versions
mediamosa-21
drupal_add_html_head($data = NULL, $key = NULL)

Add output to the head tag of the HTML page.

This function can be called as long the headers aren't sent. Pass no arguments (or NULL for both) to retrieve the currently stored elements.

See also

theme_html_tag()

Parameters

$data A renderable array. If the '#type' key is not set then 'html_tag' will be added as the default '#type'.

$key A unique string key to allow implementations of hook_html_head_alter() to identify the element in $data. Required if $data is not NULL.

Return value

An array of all stored HEAD elements.

▾ 7 functions call drupal_add_html_head()

drupal_add_html_head_link in includes/common.inc
Add a LINK tag with a distinct 'rel' attribute to the page's HEAD.
drupal_get_html_head in includes/common.inc
Retrieve output to be displayed in the HEAD tag of the HTML page.
openid_test_yadis_http_equiv in modules/openid/tests/openid_test.module
Menu callback; regular HTML page with <meta> element.
rdf_preprocess_node in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
rdf_preprocess_taxonomy_term in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
rdf_preprocess_user_profile in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
_batch_progress_page_nojs in includes/batch.inc
Output a batch processing page without JavaScript support.

Code

includes/common.inc, line 282

<?php
function drupal_add_html_head($data = NULL, $key = NULL) {
  $stored_head = &drupal_static(__FUNCTION__);

  if (!isset($stored_head)) {
    // Make sure the defaults, including Content-Type, come first.
    $stored_head = _drupal_default_html_head();
  }

  if (isset($data) && isset($key)) {
    if (!isset($data['#type'])) {
      $data['#type'] = 'html_tag';
    }
    $stored_head[$key] = $data;
  }
  return $stored_head;
}
?>