WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/apply filters"

(Using Parameter template)
Line 10: Line 10:
   
 
== Parameters ==
 
== Parameters ==
+
{{Parameter|$tag|string|The name of the filter hook.}}
; <tt>$tag</tt> : (''string'') The name of the filter hook.
+
{{Parameter|$string|string|The text on which the filters hooked to <tt>$tag</tt> are applied on.}}
; <tt>$string</tt> : (''string'') The text on which the filters hooked to <tt>$tag</tt> are applied on.
+
{{Parameter|$var|mixed|Additional variables to pass to the functions hooked to <tt>$tag</tt>.}}
; <tt>$var</tt> : (''mixed'') Additional variables passed to the functions hooked to <tt>$tag</tt>.
 
   
 
== Return ==
 
== Return ==

Revision as of 02:55, 13 January 2008

Description

Call the functions added to a filter hook.

The callback functions attached to filter hook $tag are invoked by calling this function. This function can be used to create a new filter hook by simply calling this function with the name of the new hook specified using the $tag</a> parameter.

Usage

 <?php apply_filters($tag$string); ?> 

Parameters

<tt>$tag
(string) (required) The name of the filter hook.
Default: None
$string
(string) (required) The text on which the filters hooked to $tag are applied on.
Default: None
$var
(mixed) (required) Additional variables to pass to the functions hooked to $tag.
Default: None

Return

(string) The text in $string after all hooked functions are applied to it.