1 filter.module _filter_format_is_cacheable($format)

Helper function to determine whether the output of a given text format can be cached.

The output of a given text format can be cached when all enabled filters in the text format allow caching.

Parameters

$format: The text format object to check.

Return value

TRUE if all the filters enabled in the given text format allow caching,: FALSE otherwise.

See also

filter_format_save()

File

core/modules/filter/filter.module, line 1117
Framework for handling the filtering of content.

Code

function _filter_format_is_cacheable($format) {
  if (empty($format->filters)) {
    return TRUE;
  }
  $filter_info = filter_get_filters();
  foreach ($format->filters as $name => $filter) {
    // By default, 'cache' is TRUE for all filters unless specified otherwise.
    if (!empty($filter->status) && isset($filter_info[$name]['cache']) && !$filter_info[$name]['cache']) {
      return FALSE;
    }
  }
  return TRUE;
}