Home › Forums › General Issues › Link to post or url? › Reply To: Link to post or url?
This has been requested many times and I think it’s low on the priority list. The best way to handle this is to have 3 fields. The first a radio field to select either to add a page link or a URL. Then the other two fields use conditional logic. Once this is set up
if (get_field('radio') == 'page_link') {
// code for page link
} else {
// code for url
}
I think that this is the main reason that it may be low on the developer’s “To Do” list, because with very little work it’s easy enough to accomplish. Basically this does exactly what a field that allows either a page link would need to do even if it were built in.
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.