steva
asked on
Defining functions in the WordPress functions.php file
I tried to define a function in my functions.php file as below:
The plan was then to call this from inside various action hook functions to have a record of how control passed through the code. So there might be something like:
Then if G was in the string I knew I went through that point in the code. But this doesn't work. here() doesn't appear to get entered. Does anyone see the problem?
Thanks
function here ($place) { // dbgsa
$debug = get_post_meta( $order_id, 'debug', true );
$debug .= $place';
update_post_meta($order_id, 'debug', $debug);
}
The plan was then to call this from inside various action hook functions to have a record of how control passed through the code. So there might be something like:
Then if G was in the string I knew I went through that point in the code. But this doesn't work. here() doesn't appear to get entered. Does anyone see the problem?
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
BTW, I don't think "die('Made it here!');". would work because the page doesn't get displayed. That's why I can't just echo debug comments.
And you would want to put here() somewhere that is not inside any conditional control structure. Actually, no. The whole point is to see if control made it through those conditional structures.
Thanks for your help. I split the points.