PHP / Wordpress - passing variables to create_function()

LiapAbrarah

New Member
How do I pass a variable to create_function() ?I have something like this:\[code\]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();\[/code\]but it doesn't work :(theoretically the output should be 5add_filter() is a wordpress function that allows you to change stuff around :)
 
Back
Top