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.