I have done some trouble shooting and found that the problem is in the code in functions.php
But this code was given by toolset support and was working with no issues before -
When I remove the below code the error is gone.
add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 10, 1);
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 10, 1);
function custom_generic_field_notification( $defaultPlaceHolders ) {
$newPlaceHolders = array(
'%%NAME%%' => $_REQUEST['Name'],
'%%EMAIL%%' => $_REQUEST['Email'],
'%%COMPANY_NAME%%' => $_REQUEST['company_name']
);
return array_merge($defaultPlaceHolders, $newPlaceHolders );
}
function tssupp_false_body( $post_id, $form_data ){
$forms = array( 17097,17313,17296 );
if ( in_array($form_data['id'], $forms) ){
$false_body = $_POST['description'];
if ( $false_body ) {
$args = array(
'ID' => $post_id,
'post_content' => $false_body
);
wp_update_post( $args );
}
}
}
add_action( 'cred_save_data', 'tssupp_false_body', 10, 2 );
add_filter('cred_form_validate_17097','validate_my_form_17097',10,2);
function validate_my_form_17097( $field_data, $form_data) {
// Split $field_data into separate $fields and $errors
list( $fields,$errors ) = $field_data;
// check at least one of required taxonomies set
if ( empty( $fields['contract-research']['value']) &&
empty( $fields['environmental']['value']) &&
empty( $fields['medtech']['value']) &&
empty( $fields['professional-services']['value']) &&
empty( $fields['therapeutics']['value']) &&
empty( $fields['wellness']['value'])
) {
$errors['contract-research'] = 'Environmental, Medtech, Professional Services, Therapeutics, Wellness: You must choose at least one sector';
}
if ( empty( $fields['location']['value']) ) {
$errors['location'] = 'You must select a location';
}
if ( empty( $fields['company-type']['value']) ) {
$errors['company-type'] = 'You must select a company type';
}
return array($fields,$errors);
}
add_filter('cred_form_validate_17313','validate_my_form_17313',10,2);
function validate_my_form_17313( $field_data, $form_data) {
// Split $field_data into separate $fields and $errors
list( $fields,$errors ) = $field_data;
// check at least one of required taxonomies set
if ( empty( $fields['location']['value']) ) {
$errors['location'] = 'You must select a location';
}
if ( empty( $fields['job-category']['value']) ) {
$errors['job-category'] = 'You must select a job category';
}
return array($fields,$errors);
}
add_filter('cred_form_validate_17825','validate_my_form_17825',10,2);
function validate_my_form_17825( $field_data, $form_data) {
// Split $field_data into separate $fields and $errors
list( $fields,$errors ) = $field_data;
// check at least one of required taxonomies set
if ( empty( $fields['location']['value']) ) {
$errors['location'] = 'You must select a location';
}
if ( empty( $fields['type-of-space']['value']) ) {
$errors['type-of-space'] = 'You must select a job category';
}
if ( empty( $fields['availability']['value']) ) {
$errors['availability'] = 'You must select a job category';
}
return array($fields,$errors);
}
function customise_cred_notifications( $headers, $formid, $postid, $notification_name, $notification_number ) {
$form_ids_array= array( 17097,17296,17313 );
if (in_array($formid , $form_ids_array)) {
$sender_email = $_REQUEST['Email'];
$sender_name = $_REQUEST['Name'];
$myheaders = array( "From: " . $sender_name . " <" . $sender_email . ">" );
return array_merge($headers, $myheaders);
}
return $headers;
}
add_filter('cred_mail_header', 'customise_cred_notifications', 10, 5);