summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Hodgdon2013-02-15 23:10:38 (GMT)
committerJennifer Hodgdon2013-02-15 23:10:38 (GMT)
commitc36aafa61864f64c163d52b06617d9edee96c233 (patch)
treec830b700273f503f21d10969fdbe8dc4460ce705
parent466fac1e6819d10b4dd8827254628ec5fd3204c7 (diff)
Issue #1917746 by cburschka: Update hook_filter_info() documentation
-rw-r--r--core/modules/filter/filter.api.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/modules/filter/filter.api.php b/core/modules/filter/filter.api.php
index c041eb4..49311c8 100644
--- a/core/modules/filter/filter.api.php
+++ b/core/modules/filter/filter.api.php
@@ -54,6 +54,15 @@
* Each value is an associative array describing the filter, with the
* following elements (all are optional except as noted):
* - title: (required) An administrative summary of what the filter does.
+ * - type: (required) A classification of the filter's purpose. This is one
+ * of the following:
+ * - FILTER_TYPE_HTML_RESTRICTOR: HTML tag and attribute restricting
+ * filters.
+ * - FILTER_TYPE_MARKUP_LANGUAGE: Non-HTML markup language filters that
+ * generate HTML.
+ * - FILTER_TYPE_TRANSFORM_IRREVERSIBLE: Irreversible transformation
+ * filters.
+ * - FILTER_TYPE_TRANSFORM_REVERSIBLE: Reversible transformation filters.
* - description: Additional administrative information about the filter's
* behavior, if needed for clarification.
* - settings callback: The name of a function that returns configuration
@@ -81,6 +90,7 @@
function hook_filter_info() {
$filters['filter_html'] = array(
'title' => t('Limit allowed HTML tags'),
+ 'type' => FILTER_TYPE_HTML_RESTRICTOR,
'description' => t('Allows you to restrict the HTML tags the user can use. It will also remove harmful content such as JavaScript events, JavaScript URLs and CSS styles from those tags that are not removed.'),
'process callback' => '_filter_html',
'settings callback' => '_filter_html_settings',
@@ -93,6 +103,7 @@ function hook_filter_info() {
);
$filters['filter_autop'] = array(
'title' => t('Convert line breaks'),
+ 'type' => FILTER_TYPE_MARKUP_LANGUAGE,
'description' => t('Converts line breaks into HTML (i.e. <br> and <p>) tags.'),
'process callback' => '_filter_autop',
'tips callback' => '_filter_autop_tips',