On this page
function _filter_format_is_cacheable
_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
File
- 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;
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!filter!filter.module/function/_filter_format_is_cacheable/7.x