If you have an ID column, you can go to its settings, and under Filtering tab, change filter type to "Text". Then, in Predefined Values add %CURRENT_USER_ID%, so the table will be filtered with the ID of a user currently viewing the table.
If you don't hide the filter with CSS, your customers will be able to change this, to see the entire table.
There's also a possibility to create an SQL Query based table, where you can include the condition in the query, like:
SELECT * FROM yourTable
WHERE userid = %CURRENT_USER_ID%
In that case, you too would not be able to see the data in the table if you don't have your ID anywhere in the table.
I'd like to know, is wpdatatables able to filter rows form a table taking the current userID? (the userID corresponding to the user logged in)
Thank you!
Hello Pablo
Thank you for your interest in our plugin.
If you have an ID column, you can go to its settings, and under Filtering tab, change filter type to "Text". Then, in Predefined Values add %CURRENT_USER_ID%, so the table will be filtered with the ID of a user currently viewing the table.
If you don't hide the filter with CSS, your customers will be able to change this, to see the entire table.
There's also a possibility to create an SQL Query based table, where you can include the condition in the query, like:
In that case, you too would not be able to see the data in the table if you don't have your ID anywhere in the table.
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