• Resolved brianborisson

    (@brianborisson)


    Hi,

    As per your request I will ask the question here:

    How can you make sure that:

    – People must be logged in before the Form 7 will appear and they will be able to fill it in and submit (not sure how to do this)

    – Once submitted, the form should be mapped to a custom post with the help of the Post My CF7 Form plugin, in draft form (I was able to do this)

    – Once I approve the custom post, it will be displayed on the website (I was able to do this)

    – Once the custom post is live, I want ONLY the original logged in submitter of the form to be able to send in another (or the same?) form in order to make changes to his or her custom post that is now visible on the website (not sure how to do this).

    – After the changes are submitted with the form, I want to be able again to approve the draft before it goes live again.

    Can you let me know if and how this is possible?

    Thanks,

    Brian

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter brianborisson

    (@brianborisson)

    Ok I tested it, understand your point now: fields already submitted reload again in the form when the original form submitter is logged in.

    However: it seems it automatically updates the post without giving me (the administrator) the chance to review the revised post in draft form again?

    Plugin Author Aurovrata Venet

    (@aurovrata)

    the chance to review the revised post in draft form again?

    it doesn’t? It should. Let me check and revert back.

    Thread Starter brianborisson

    (@brianborisson)

    Ok thanks, let me know

    Thread Starter brianborisson

    (@brianborisson)

    Hi @aurovrata,

    1) did you have the chance to look into the revised post issue (should be draft mode first again)?

    2) I also noticed another issue after experimenting. When I map a required file (file*) field to an image field in ACF, the image is not displayed in the post draft mode.

    So even while it is a mandatory field that the formfiller did fill in, it does not appear (it’s not visible to me) when I want to publish the submitted draft form/post.

    I need the ACF field to be an image field, in order to showcase it front-end in the post.

    Not sure why the form 7 file* field is not displaying in the image ACF field. Because the same form 7 file* field IS appearing/being displayed in the standard wordpress Featured Image field in the backend post section.

    Do you know how to solve this issue by chance?

    • This reply was modified 3 years, 8 months ago by brianborisson.
    Plugin Author Aurovrata Venet

    (@aurovrata)

    1 – no not yet.

    2- that simply does not make sense. If files could be preloaded it would be a major security risk!

    Do you know how to solve this issue by chance?

    ACF stores fields in its own format which is not always compatible with this plugin. Other users have reported similar issues.

    You will need to hook the action fired at the end of the submission process to programmatically map your ACF fields as per the ACF expected format, then they will appear properly.

    However, I would recommend you ditch ACF and stick to WordPress standards, on the long run you will gain in maintenance effort.

    Thread Starter brianborisson

    (@brianborisson)

    Hi thanks for the answers.

    Regarding 2) Could you help out with explaining more about how this works with the hook? Not sure where to add code or a hook…

    I want the form submitter to be able to upload 3 images (different artworks). These artworks should be mapped in 3 custom acf fields: artwork 1, 2 and 3.

    I already created the front end page, the acf image fields appear on the page. However, the mapping from form 7 (the upload) to the acf image field backend does not work. So could you tell me please where and how to add the hook to make this work?

    For now, I don’t see how I can stick with WordPress standards as they only provide the Featured Image option to map the form 7 form to. I need 3 extra image fields, therefore I use ACF.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    For now, I don’t see how I can stick with WordPress standards as they only provide the Featured Image

    you need to look at galleries.

    Could you help out with explaining more about how this works with the hook?

    what you are trying to do is highly advanced and requires coding knowledge. I strongly recommend you hire a developer to solve this. If you really want to learn to do this by yourself, then you need to start with basic PHP/JavaScript/WordPress tutorials on YouTube, and when you start to have specific coding questions then seek help on the StackOverflow forums.

    On this forum, I will give you general guidelines only.

    The hook you will need to use to reformat the field to what the ACF plugin expects is the Action #16 in the list of Actions & Filters (see screenshot #8)

    Thread Starter brianborisson

    (@brianborisson)

    Hi,

    I have no time to start form scratch learning all the coding basics, although I think it is an interesting field of work.

    I think the video you placed is helpful, a similar video to explain a bit more about hooks and ACF would help many people I think, including me.

    If I add Action #16 hook:

    add_action('cf7_2_post_form_submitted_to_artists', 'new_artists_mapped',10,4);
    /**
    * Function to take further action once form has been submitted and saved as a post.  Note this action is only fired for submission which has been submitted as opposed to saved as drafts.
    * @param string $post_id new post ID to which submission was saved.
    * @param array $cf7_form_data complete set of data submitted in the form as an array of field-name=>value pairs.
    * @param string $cf7form_key unique key to identify your form.
    * @param array $submitted_files array of files submitted in the form, if any file fields are present.
    */
    function new_artists_mapped($post_id, $cf7_form_data, $cf7form_key, $submitted_files){
      //do something.
    }

    to my functions.php, then could you tell me what I have to change in the above hook to make sure a Form 7 ‘file’ field will display images in an ACF image field?

    Do you also have to add a hook to the custom meta field when you make the mapping?

    Choose for the ‘hook with a filter option’ to connect to the ACF field?

    add_filter(‘cf7_2_post_filter-artists-‘,’filter_artists_’,10,3);
    function filter_artists_($value, $post_id, $form_data){
    //$value is the post field value to return, by default it is empty. If you are filtering a taxonomy you can return either slug/id/array. in case of ids make sure to cast them integers.(see https://codex.www.ads-software.com/Function_Reference/wp_set_object_terms for more information.)
    //$post_id is the ID of the post to which the form values are being mapped to
    // $form_data is the submitted form data as an array of field-name=>value pairs
    return $value;
    }

    Like I said, I don’t have the time or background to do this myself, and I could invest a lot of time and energy starting to learn code from scratch or dive into technical support forums to try to find the right person to support me in this.

    So if it is a lot of work, I assume I have to do the above. If it is only a matter of copy pasting the right piece of code (as I displayed above) in my functions.php, with a bit of support here, I could do this fast and the issue is solved.

    So let me know please in how far you can support here.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    I think the video you placed is helpful, a similar video to explain a bit more about hooks and ACF would help many people I think, including me.

    I would if I used ACF, but I have never used it nor do I intend to in the future. Although others might do a video, who knows.

    So let me know please in how far you can support here.

    I just don’t do specific code support. I put a lot of energy in maintaining/coding this plugin for the community out of my own pocket, I make a living being hired to do specific custom code. I am happy to share general knowledge, but I don’t do coding for free.

    As I repeated on multiple responses, you need to hire a coder if you are not ready to do it yourself.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘How to have only logged in users post via form?’ is closed to new replies.