You are here

function token_render_cache_set in Token 7

Same name and namespace in other branches
  1. 8 token.module \token_render_cache_set()

Coyp of drupal_render_cache_set() that does not care about request method.

1 call to token_render_cache_set()
theme_token_tree in ./token.pages.inc
Provide a 'tree' display of nested tokens.

File

./token.module, line 1211
Enhances the token API in core: adds a browseable UI, missing tokens, etc.

Code

function token_render_cache_set(&$markup, $elements) {

  // This should only run of drupal_render_cache_set() did not.
  if (in_array($_SERVER['REQUEST_METHOD'], array(
    'GET',
    'HEAD',
  ))) {
    return FALSE;
  }
  $original_method = $_SERVER['REQUEST_METHOD'];
  $_SERVER['REQUEST_METHOD'] = 'GET';
  drupal_render_cache_set($markup, $elements);
  $_SERVER['REQUEST_METHOD'] = $original_method;
}