I've searched everywhere and I can't find a definitive answer to my question. I'm having trouble getting a user defined php function to execute inside of a custom block.
Code:
$my_output = 'Bad';
if(!function_exists('good'))
{
function good()
{
$my_output = 'Good';
}
}
good();
return $my_output;
This is just a test code I wrote to see if this was indeed my problem and it was. The output is always "Bad". Any suggestions to get this to work would be appreciated.
Also, do these same issues arise if I define the php code as a plugin? I haven't been able to get it to work that way either and I figured it would be better to define the code in the block anyways.