Tell us what you are trying to do?
I made a post form, I have a snippet to update the post title from the custom fields (title, name, surname).
Everythings works well, but the permalink still looks like this "specialiste_sps=cred-auto-draft-feb2e5fd3f52612416233352093c51ad"
Is it possible to make the permalink from custom fields?
I´ve read multiple support threads but couldn´t make it work.
I use this snippet for Post form:
add_action('cred_save_data','func_generate_automatic_post_title', 10, 3);
function func_generate_automatic_post_title($post_id,$form_data) {
if ($form_data['id']==4505 or $form_data['id']==4519) {
$types_fields = get_option('wpcf-fields');
$sps_titul = $types_fields['sps_titul']['data']['options'];
$all_opt = array();
foreach($sps_titul as $k=>$v):
$all_opt[$v['value']] = $v['title'];
endforeach;
$name = get_post_meta($post_id, 'wpcf-sps_jmeno', true);
$surname = get_post_meta($post_id, 'wpcf-sps_prijmeni', true);
$titul = get_post_meta($post_id, 'wpcf-sps_titul', true);
$title= $all_opt[$titul]." ".$name." ".$surname;
$args = array('ID' => $post_id, 'post_title' => $title);
wp_update_post($args);
}
}
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?
hidden link
Thank you in advance!
Best Regards
David