How to allow editing field values thru Frontend Submission by the author only?

Support MB Frontend Submission How to allow editing field values thru Frontend Submission by the author only?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #10066
    EddyPiVEddyPiV
    Participant

    Members of my website enter their profile information through Frontend Submission.
    The info is shown in the frontend: post + all fields.

    How do I give a member the possibility to edit his data in the frontend?

    First of all: only for his own post (there is only 1 post per member) there should be a link (preferrably a button) to this edit form.
    How to do that?

    Second: how to have an edit form in Frontend Submission with all values from the database filled?

    Thanks for your help.

    #10240
    EddyPiVEddyPiV
    Participant

    Hi Anh,

    I have installed the Frontier plugin, which allows my users to edit their own post(s) in the front-end.
    All well, but what remains is how to allow them to edit the MB fields in the front-end?

    #10297
    lighterdayzlighterdayz
    Participant

    Following for the answer.

    #10305
    Anh TranAnh Tran
    Keymaster

    Hi,

    Each submitted post will have an unique post ID. You need to get that ID and set it in the post_id attribute of the mb_frontend_form shortcode. That will allows user to edit the info.

    There is a similar topic that you might be interested in.

    #10371
    EddyPiVEddyPiV
    Participant

    That works great, to a large extent.

    As I want to allow users to edit their own fleds in the frontend, it should only be possible for their own posts, i.e. where the author = logged in user.

    Any suggestion?

    #10372
    Anh TranAnh Tran
    Keymaster

    You can:

    • Get the author of the submitted post (via post_id)
    • Get the current user ID

    And just compare them. When they match, output the shortcode. Otherwise, output some error message.

    #10373
    EddyPiVEddyPiV
    Participant

    That's how far I got as well. I was hoping you could give me some php code, as I am not familiar with php myself. And I guess this may be useful for other users as well?

    #10378
    EddyPiVEddyPiV
    Participant

    I managed to display the link only for the author. This item can be closed now. Thanks.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to allow editing field values thru Frontend Submission by the author only?’ is closed to new replies.