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.
This hook not worked for me, but the mainwp_pro_reports_custom_tokens hook was fine, I can made the customizations for my custom token.
Thank you
WordPress® is a registered trademark of the WordPress Foundation, and WooCommerce® is a registered trademark of WooCommerce, Inc. MainWP is an independent product and is not affiliated, associated, or endorsed by the WordPress Foundation, WooCommerce, Inc., or Automattic Inc., except where noted under the Jetpack® API and Trademark License Agreement. All product names, logos, and brands are property of their respective owners and are used for identification purposes only.