Okay
  Public Ticket #3240841
limiting data rows for currently logged use
Closed

Comments

  • milan started the conversation

    i am using Divi theme & forminator plugin for forms and listing forms in a table with wpdatatables.  I already added hidden field (User-Id) to get the user ID.

    Right now my website is in test mode & i created few demo users. And due to lack of out the box solution, All of the users can see each other’s submissions on the table  at this moment  

    Link: https://quasarfin.com/view-loans/

    But i want to restrict and let current user view & edit only his submissions. So each user will be able to view & edit their submissions only and as an admin i can still view all of the submissions on table. 

    i am new to wordpress and i have very little knowledge of PHP so i am not able to write any queries which can solve my issue. So if there is any solution in paid version, then please share with me so i can just hire a developer and make it work. I will buy the plugin if i can get the solution.

  •  1,846
    Miloš replied


    Hi, milan.

    Sorry for the delayed response.

    -

    Yes. There is a workaround for this use-case with our premium plugin.

    We have advanced filters available, which you can use to predefine a filter for the "user ID" column.

    I will show you an example.

    - First we add that hidden "user_id" column on the source Form, which you can hide in our plugin from the front-end if needed. 

    We will then add a predefined filter value to this column, using a PlaceHolder "%CURRENT_USER_ID%";

    - Check that the filter type is set as "Text", as shown on this screenshot.

    8249361981.png

    - Here is how an example table linked to a source file looks before we make any changes, with visible filters above the table.

    7932387639.png

    And now, when we set the pre-filter, with Administrator logged in ( In our case, the user ID is 1), we only see rows matching that user ID.

    3633379684.png

    - (If you need more detailed information about using Placeholders in wpDataTables, here is our documentation about that https://wpdatatables.com/documentation/table-features/using-placeholders/);

    - The user_ID filter is still visible, which means, if someone changes/deletes this value, they could see the whole table.

    We will hide it from the front-end with some custom CSS added in the "Customize" section of the main table settings.

    - It should be easy to do, depending on your knowledge of HTML and CSS.

    You have to find the correct selector using the browser inspector tool, add the style "display:none" property to it, and it will disappear from the front-end.

    On our example table, the custom CSS is :

    #table_1_5_filter_sections  {
        display:none; }
    5537273103.png

    - Now, the user_ID filter is gone from the front-end.

    8120839900.png

    - Optionally, you can hide the user_id column from the front-end, if needed, either using the column settings tab or the "column list" button from the back end Admin area.

    1618300341.png

    - If you need more details about this, don't hesitate to contact us further.

    And i just wanted to point out that you can try wpDataTables before purchasing

     on our sandbox Demo sites ( you can find links for the main plugin Demo,  

    as well as add-on Demos, in my signature),

    and there is a 15-day money-back guarantee period, 

    so if you purchase the plugin, you can safely fully test it out, and if it doesn't fit your needs you can request and receive a refund in that period. ( same goes for all plugins and add-ons)

    Let me know if you have any additional questions. smile.png


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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