Returns a list of all filters provided by modules.
array An array of filter formats.
function filter_get_filters() {
$filters =& drupal_static(__FUNCTION__, array());
if (empty($filters)) {
foreach (module_implements('filter_info') as $module) {
$info = module_invoke($module, 'filter_info');
if (isset($info) && is_array($info)) {
// Assign the name of the module implementing the filters and ensure
// default values.
foreach (array_keys($info) as $name) {
$info[$name]['module'] = $module;
$info[$name] += array(
'description' => '',
'weight' => 0,
);
}
$filters = array_merge($filters, $info);
}
}
// Allow modules to alter filter definitions.
drupal_alter('filter_info', $filters);
uasort($filters, '_filter_list_cmp');
}
return $filters;
}