Normally in PHP a function call accepts parameters and thus you can pass outside variables into the function:
//variable is declared
$foo = 'bar';
//function is created
function foobar($parameter) {
echo $parameter;
}
//function is called with previously declared variable
foobar($foo);
Outputs: bar
However, when using WordPress Hooks the callback doesn't accept parameters and thus I'm wondering if there's another way to pass variables declared outside of the function's scope into that function?
('global' variables doesn't seem to work: probably because all theme/plugin-functions are nested functions thus the parent level isn't truly global)