• Part, I am trying to configure the form in such a way that it only edits one field in the post. However, it creates a new post every time and does not rewrite values that have already been completed.

    I use the hook for this:
    add_filter (‘cf7_2_post_filter_user_draft_form_query’, ‘custom_post_query’, 10.2);
    function custom_post_query ($ query_args, $ post_type) {
    if (‘my-mapped-post’ === $ post_type) {// check for your mapped post type.
    // set up your custom $ query_args
    }
    return $ query_args;
    }

    I enter the hook in the additional settings tab. I don’t know if this is the correct place;)

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

    (@aurovrata)

    I enter the hook in the additional settings tab. I don’t know if this is the correct place;)

    all codes should be added to your functions.php file

    I am trying to configure the form in such a way that it only edits one field in the post. However, it creates a new post every time and does not rewrite values that have already been completed.

    indeed, when the form is loaded, you need to set it up to save to the existing post, else it will simply keep saving to a new post

Viewing 1 replies (of 1 total)
  • The topic ‘Editing only one field in a post’ is closed to new replies.