You can use placeholders in URL, for example.com/%VAR1%/, and then add some value to Var1, and it will be applied for this URL.
Also, you can use other placeholders, like %CURRENT_USER_ID% and in that way, only the data based on the ID of the currently logged-in user would be displayed.
You can use placeholders as predefined filtering values for string-type columns, but the user cannot select the value which will be forwarded to the placeholders in JSON URL. The only thing you can do is create a custom form on some page, and forward values from the input as POST variables on some page, where this table is; then through a hook wpdatatables_before_get_table_metadata replace it with placeholders var1, var2, or var3, which will be forwarded to the URL.
I would love to add the user ID or a custom field saved at the user level to the http GET request - ie
GET https://api.com/api/user/[WP USER ID]
GET https://api.com/api/user/[ACF-usercustomfield]
Then the table will show different results depending on who is logged in. Is that possible? or is it on the roadmap?
Hello Ilan
You can use placeholders in URL, for example.com/%VAR1%/, and then add some value to Var1, and it will be applied for this URL.
Also, you can use other placeholders, like %CURRENT_USER_ID% and in that way, only the data based on the ID of the currently logged-in user would be displayed.
You can use placeholders as predefined filtering values for string-type columns, but the user cannot select the value which will be forwarded to the placeholders in JSON URL. The only thing you can do is create a custom form on some page, and forward values from the input as POST variables on some page, where this table is; then through a hook wpdatatables_before_get_table_metadata replace it with placeholders var1, var2, or var3, which will be forwarded to the URL.
API needs to return the JSON format, adjusted to wpDataTables.
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