• Resolved mahoney

    (@mahoney)


    How do I pass the WordPress user id into a form on the front end? I have added it everywhere there is a Where clause. If I manually add the user id it shows the record under view. I just can’t figure out to pass it into the form on the front end.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @mahoney,

    Could you send us more details about your table? Is this for a data table or a data project?

    You can also send us a message in Contact | WP Data Access if you want to share more information privately.

    We’ll wait for your response!

    Thread Starter mahoney

    (@mahoney)

    The table is simple: id, item, image, wp_user_id

    what I need to happen is when a logged in user creates/edits a record is for the @wpda_wp_user_id to be passed into the record for wp_user_id.

    I guess this would be a data project since it needs to be on the front end forms.

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @mahoney,

    Thanks for the clarification!

    I think you need to set a trigger for that if you want the current logged in ID to be entered when editing/inserting a new record.

    Please see more information here: WordPress user ID – Database triggers

    Let us know if that helps! ??

    Thread Starter mahoney

    (@mahoney)

    Thank you for the reply. I found that using the Environment Variable $$USERID$$ placed in the Default Value under Project Templates >>Data Entry worked for me. I unchecked Visible and checked Read Only.

    Triggers look very interesting, where would I place the code for a Trigger?

    Leeberty

    (@aaronvincentlee)

    Hi @mahoney ,

    On behalf of Kim, you are most welcome!

    You can execute the triggers via query builder.

    Please see: https://wpdataaccess.com/docs/query-builder/query-builder-getting-started/

    Let us know if you have further questions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘@wpda_wp_user_id’ is closed to new replies.