Hello
I'm trying to understand some of the function in WordPress, but I can't get my head around what apply_filters(...) actually does.
Is someone able to clear this up for me with a few examples?
Cheers
Turgs
Hello
I'm trying to understand some of the function in WordPress, but I can't get my head around what apply_filters(...) actually does.
Is someone able to clear this up for me with a few examples?
Cheers
Turgs
apply_filters($tag, $value)
passes the 'value' argument to each of the functions 'hooked' (using add_filter
) into the specified filter 'tag'. Each function performs some processing on the value and returns a modified value to be passed to the next function in the sequence.
For example, by default (in Wordpress 2.9) the the_content
filter passes the value through the following sequence of functions:
In the most basic terms, apply_filters is used to initialise a filter hook... add_filter assigns a new function to hooks that have already been created.
Here's what I'm gleaning, upon considering the most popular answer and additional resources:
<p>
tags, smiley faces will convert to icons, etc.