I have a Mysql query based wpdtatachart where where %VAR1% = 1 in the dashboard.
In php, I
echo do_shortcode('[wpdatachart id=4 var1=5]');
However, it still renders the chart with var1 = 1. I tried substituting it with a php variable, yet it still renders it as var1 =1. I tried to leave %VAR1% as NULL in the dashboard but this was not allowed.
So you will see that you can pass placeholder in query and create table and then pass different placeholders values in shortcode on each page so you will get different data on each page.
About the chart, when you create this table from above you will make chart that you need for it and then turn on option Follow table filtering in charts which means that chart will be filtered based on data in table(on each page different because of different value for placeholders)
You can take a look in our documentation about Actions and Filters which are defined in wpDataTables plugin for customization's by developers.(if you need some custom solutions).
So, it is not possible to use placeholders in charts shortcodes, but when you insert placeholders in table shortcode and from that table you made chart where you will enable option Follow table filtering in charts chart will be updated with data in table that is filtered with that placeholder.
I have a Mysql query based wpdtatachart where where %VAR1% = 1 in the dashboard.
In php, I
However, it still renders the chart with var1 = 1. I tried substituting it with a php variable, yet it still renders it as var1 =1. I tried to leave %VAR1% as NULL in the dashboard but this was not allowed.
How does one override %VAR1% in php?
Hello jimmy.
You can take a look in our documentation about Making dynamic SQL Queries with placeholders.
So you will see that you can pass placeholder in query and create table and then pass different placeholders values in shortcode on each page so you will get different data on each page.
About the chart, when you create this table from above you will make chart that you need for it and then turn on option Follow table filtering in charts which means that chart will be filtered based on data in table(on each page different because of different value for placeholders)
You can take a look in our documentation about Actions and Filters which are defined in wpDataTables plugin for customization's by developers.(if you need some custom solutions).
So, it is not possible to use placeholders in charts shortcodes, but when you insert placeholders in table shortcode and from that table you made chart where you will enable option Follow table filtering in charts chart will be updated with data in table that is filtered with that placeholder.
Best regards.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables