When using the count tokens (eg. [plugin.updated.count]) within a PDF template for the Pro Reports, nothing seems to be returned when the count is zero. I would like to have the count return zero in this instance and am pretty sure this is a bug and should not be considered expected behavior.
I am aware of the Report Data that can restrict to Hide if Empty, but don’t think this is related. If I toggle that to any setting, I still see no change in this token. Thanks for looking into this.
It does look like I’m including these in a bit different way than the included reports do within their overview in that I am not wrapping the in the config-section-data and remove-if-empty delimiters. I would still think this should work, though. If I should be using these differently, please advise. Thanks!
But instead of PHP-variables that I can work with, I get strings that do not react to PHP functions in a way I would expect. The values of the variables are correct. In this example, there are 32 backups and 21 plugin updates. Every other value, like the string length, is not correct, though:
Var_dump of nr_of_wp_updates:
string(25) “”
Var_dump of nr_of_theme_updates :
string(21) “”
Var_dump of nr_of_plugin_updates :
string(22) “21”
Var_dump of nr_of_backups :
string(22) “32”
I would expect the length of the contents of variable $nr_of_wp_updates to be 0, but it is 25. It seems to be the length of the token itself ([wordpress.updated.count]).
I don’t think the tokens are rendered as shortcodes, so the do_shortcode functions just returns whatever was passed to it (the token itself), then MainWP does a replace. I thought of trying some similar approach using ob_start and ob_get_clean, but figured there should be a better way to handle this natively.