I’m new here, started with MainWP just 2 weeks ago Could you help me please, how can I get the value of a custom token in PHP?
I created a custom Pro Report template, and I can “echo” the content of a custom token using the [my_custom_token] syntax, but how can I get the value and pass it to a variable? I cannot figure it out.
I’d like to write some if statements in the custom report template, and my conditions based on the custom token string’s value and length.
The values of tokens are not available when the template is loaded. It will be available in the $data array in the hook mainwp_pro_reports_addition_custom_tokens like in example below.
So all statements and conditions will be available in the hook and will be able to show the custom value by using custom tokens in the template, like the token [custom.update.total] in the example.