somehow the first input is saved as it should be in the artists (->hidden link) see added picture .
am I right supposing that somehow I should replace the automatically given title "CRED Auto Draft 67e9e21e941c6b1a3338e6b61fde5ef1" with something else ? -> Family-name+name+number (would the number be necessary to prevent an over-writing in case family-name and name of 2 persons are equal or does the data-bank alert before over-writing?
Hello,
In the post form "create_artist_post":
hidden link
there isn't post title field, but it is required field to for WordPress to create new post, so Toolset Forms plugin will generate title for you: CRED Auto Draft …
And there isn't such kind of built-in feature to: automatically given title with something else ? -> Family-name+name+number
It needs custom codes, I have setup a demo in your website:
Since your website isn't in English, I have to guess these:
I assume we are talking about the post form for creating new "artist" post:
hidden link
Here are detailed steps:
1) Dashboard-> Toolset-> Settings-> Custom codes, add one item "auto-artist-title", with below codes:
add_action('cred_save_data', function($post_id, $form_data){
if( !in_array( $form_data['id'], [203] ) ){
return;
}
$arr[] = get_post_meta($post_id, 'wpcf-apellido', true);
$arr[] = get_post_meta($post_id, 'wpcf-nombre', true);
$arr[] = $post_id;
$arr = array_filter($arr);
$post_title = implode('-', $arr);
$data = array(
'ID' => $post_id,
'post_title' => $post_title,
'post_name' => sanitize_title($post_title),
);
wp_update_post( $data );
}, 10, 2);
2) Test it in frontend:
hidden link
fill and submit the form
3) See the results here:
hidden link
More help:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Tis issue is resolved now. Thank you!