WordPress Plugin Released: Link Picker Field for Advanced Custom Fields
In the standard ACF plugin there are a few ways to allow a user to select a link:
1. You could use the ‘Page Link‘ field type where you select the page you want to link to from a dropdown.
2. You could use the ‘Post Object‘ field type where, again, you select the page/post etc from a dropdown.
3. You use the normal ‘Text’ field type and allow the user to manually enter the URL.
There isn’t a way however to allow the user to do one or the other.
Let’s take a look at the standard WYSIWYG in WordPress, inparticular the method in which we add links. You select the text you want to hyperlink and click the ‘Insert/Edit Link’.
You then get presented with a modal popup allowing you to choose the link:
Wouldn’t it be great if this feature was available to users but via a custom field? Well now you can through use of our new link picker plugin.
How It Works
Once the add-on has been installed as a plugin you will have a new option when selecting the field type:
Once added the user will then be presented with an option to select the link:
And voila… the standard popup we’re so familiar with from use of the WYSIWYG: