When two people open the form, they get the same _cred_cred_prefix_post_id, so when the form is submitted the content of the post of the first submitted form get replaced by the content of the second.
We try to use the cred_before_save_data hook to replace the id in the form data without success.
This is the hook code :
add_action('cred_before_save_data_288', 'valide_cred_cred_prefix_post_id',15,1);
function valide_cred_cred_prefix_post_id($form_data){
if (isset($_REQUEST['_cred_cred_prefix_post_id']) || isset($form_data['_cred_cred_prefix_post_id'])){
$goodid=good_id($_REQUEST['_cred_cred_prefix_post_id']);
$_POST['_cred_cred_prefix_post_id'] = $goodid;
$_REQUEST['_cred_cred_prefix_post_id'] = $goodid;
$form_data['_cred_cred_prefix_post_id'] = $goodid;
}
return $form_data;
}
function good_id($id){
while (get_post_status($id)) {
$id++;
}
return $id;
}
Hi, I see that your plugins are quite out of date, as well as your WordPress installation. Quite a few updates have been made to CRED, including some bug fixes in the new post creation sequence. My first recommendation is to update WordPress and all Toolset plugins and retest. Make a full backup of your site files and database before you try to update.
https://toolset.com/download/toolset-cred/#changelog