Hi
How do I pass a variable to create_function() ?
I have something like this:
function my_hook_function(){
$var = 10;
apply_filters('hook', $var);
return $var;
}
$variable = 5;
$function = create_function('', 'return $variable;');
add_filter('hook', $function);
echo my_hook_function();
but it doesn't work :( theoretically the output should be 5
add_filter() is a wordpress function that allows you to change stuff around :)