• Resolved tsvn

    (@tsvn)


    Hi

    I have added the filter to auto-publish and also the filter to allow users to edit their own post and it works fine. However, I would like to allow users to create multiple posts.
    Is this possible? Or do I have to choose between allowing users to create one post which they can edit, or multiple post which they can’t edit?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    However, I would like to allow users to create multiple posts.

    currently this is possible but only the last post will be editable.

    multiple editable posts

    There is a built-in mechanism to do this. You need to use the cf7_2_post_id attribute in your contact form 7 shortcode. in order to dynamicaly load a differen post, you will need to dynamically build the shortcode. This what I would do,

    1. List your user’s post on a page and provide a link for each which call a form page template with the post’s id as a url attribute
    2. in your form page template will seek the url attribute post id to load in the cf7 form, ($post_id=$_GET['post']) and if one is found, include it your dynamic form shortcode,
      do_shortcode('[cf7-form cf7key="your-form-key" cf7_2_post_id="'.$post_id.'"]');

    An alternative approach if you do not have too many posts for each user, is to build all your forms and hide them in an accordeon display. The plugin allows you to work with multiple forms per page.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    NOTE: it is important that when you dynamically load a saved post for editing for a given user using a url attribute, to actually check that the current logged-in user is the author of this saved post (which when initially submitted and saved by the plugin is the default behaviour to assign the post to the user that submitted the form), this will ensure that no user can trick the system and load another user’s data.

    Thread Starter tsvn

    (@tsvn)

    Thank you so much, just what I needed.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Thank you so much, just what I needed.

    your wc, do write a review when you get a moment free

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple editable posts?’ is closed to new replies.