Determines 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.
$format: The text format object to check.
TRUE if all the filters enabled in the given text format allow caching, FALSE otherwise.
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;
}