Is this a good example of usage of current_filter()
?
<?php
add_filter("_my_filter", "common_function");
add_filter("_another_filter", "common_function");
function common_function(){
$currentFilter = current_filter();
switch ($currentFilter) {
case '_my_filter':
echo "Called by My Filter";
break;
case '_another_filter':
echo "Called by another filter";
break;
}
}
So I am guessing current_filter()
is used to get the name of the filter for which the current execution is happening?