Hi,
Could you please help me?
I created a group of fields with ACF.
To be completed by users in the frontend, this one is linked to a FluentForm form.
I would like to allow users to view the page they have created through this form.
I have a group of fields ‘profil-champs’ which creates posts in ‘profil’
The goal is that each person who has completed their profile can have a direct link to it.
How to do it?
You can grab the post ID when you programmatically create it after your user completes their form then return the permalink with get_permalink($post_id)
.
Thank you for your help, Following your indication, I did this with chatGPT, Here is my code:
<? php if (is_user_logged_in()) { $user_id = get_current_user_id(); $custom_posts = get_posts(array( 'post_type' => 'profil', 'auteur' => $user_id, 'posts_per_page' => 1, )) ; si (! vide($custom_posts)) { $custom_post_url = get_permalink($custom_posts[0]->ID) ; ? > <a href="<? php echo esc_url($custom_post_url) ; ? >" class="mon-bouton">Voir mon profil</a> <? php } else { echo 'Vous n\'avez pas encore créé de profil.' ; } } else { echo 'Connectez-vous pour voir votre profil.' ; } ? >