How to return value when use add_filter in WordPress?

Posted by Ramesh Singh | Updated on

If you want to return value when use add_filter in WordPress? When registering a filter(or basically calling apply_filters), you should call the function with at least two arguments – name of the filter to be applied and the value to which the filter will be applied.

Any further arguments that you pass to the function will be passed to the filtering functions, but only if they have requested additional arguments. Here’s an example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers