A
Anonymous
Guest
Hi,
Still new to PHP. I am having trouble with this. I want to hook into a specific place, and one thing I want to do there is update a global variable.
In my main php file, I have just put variable
In a functions file, I have put:
Theoretically, that should work shouldn't it?
Still new to PHP. I am having trouble with this. I want to hook into a specific place, and one thing I want to do there is update a global variable.
In my main php file, I have just put variable
Code:
$xyz;
In a functions file, I have put:
Code:
function save_xyz( $user_id ){
global $xyz;
if( !xyz ){
$xyz = 1;
return $xyz;
}
$xyz = 2;
return $xyz;
}
add_action( "pmpro_after_checkout", "save_xyz" );
Theoretically, that should work shouldn't it?