About ACF plugin file meta-field
-
Hello, I am having trouble modifying the following.
I changed it to post files with reference to number 28 in the FAQ, but when I prepare two file fields and send a file attachment in the first field only, the first attachment is also registered in the second field.
How can I customize this?
add_filter('cf7_2_post_metafield_file', 'change_meta_field_file_format', 10, 6);
function change_meta_field_file_format( $file_format, $attachment_id, $post_id, $post_field, $form_field, $cf7_key ){
/*
* $file_format, default format is url path.
* $attachment_id, file media attachment post id.
* $post_id, form submission mapped to post.
* $post_field, the meta post fields being saved.
* $form_field, the form field from which it was submitted.
* $cf7_key the current form being mapped.
*/
$file_format = $attachment_id;
return $file_format;
}
- You must be logged in to reply to this topic.