1 filter.module filter_get_filters()

Returns a list of all filters provided by modules.

Return value

array: An array of filter formats.

File

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

Code

function filter_get_filters() {
  $filters = &backdrop_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,
            'default settings' => array(),
          );
        }
        $filters = array_merge($filters, $info);
      }
    }
    // Allow modules to alter filter definitions.
    backdrop_alter('filter_info', $filters);
    backdrop_sort($filters, array('title' => SORT_STRING));
  }

  return $filters;
}