Okay
  Public Ticket #915042
Allowing users to edit only their own data
Closed

Comments

  •  2
    hcmeyer started the conversation

    Hi, thx for the good video but I do not understand where wpdatatables knows the WP user-id from.... I see no connection between the user-id in the table and the user id from Wordpress . . .

    In the video you are registered with user 1 = Is this the wp_user ID ? And where do I have to connect this in the new table? Sorry, sure a stupid question, but I can´t reproduce this example.

    Christian

  • [deleted] replied

    Hi hcmeyer,
    Thank you for your purchase.

    I do not understand where wpdatatables knows the WP user-id from
    - There is a function in WordPress where you can get current logged in user - wp_get_current_user();

    In the video you are registered with user 1 = Is this the wp_user ID?
    -
    Yes, that is WordPress User ID

    And where do I have to connect this in the new table?
    I don't understand this question. Can you describe it in more details. When you are creating a table where you want to Allow users to edit only their own data you have to:

    • Click “Front-end editing” checkbox to enable front-end editing;
    • Click “Users see and edit only their data” checkbox to enable the features of editing only own rows.
    • Select “user_id” in the “User ID Column” dropdown.
    • Scroll down to the columns settings and untick the “Visible” checkbox for the “User ID” column since we don’t actually need to see this information in the table.
    • Save the table.

    You can also take a look at documentation from our website at this link - Text - Video