function _filter_format_is_cacheable

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()

1 call to _filter_format_is_cacheable()
filter_format_save in drupal/modules/filter/filter.module
Saves a text format object to the database.

File

drupal/modules/filter/filter.module, line 669
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;
}