Home › Forums › Front-end Issues › Get fields from a clicked link › Reply To: Get fields from a clicked link
Hi there,
Wordpress has a built-in function to determine the post ID from a given URL : url_to_postid( string $url );
It will return the post ID or 0 on failure.
1) So first, you’ll probably target your clicked url with javascript and store it.
2) Then you could use the wordpress function to get the post ID and your acf values.
3) Finally, you launch your modal if you get all your needed datas.
Let me know if it helps,
RemSEO
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.