This add on for the already established Advanced Custom Fields plugin adds a new field type called ‘Link Picker’ which allows the user to enter a URL, or select from the existing pages. It is a thin wrapper around the link selector included with the WYSIWYG field editor.
This plugin is forked from the plugin of the same name hosted at https://github.com/BIOSTALL/ACF-Link-Picker-Field. This version is hosted at https://github.com/ahebrank/ACF-Link-Picker-Field and issues and PRs should be submitted there.
Note: Advanced Custom Fields must be installed for this add-on to work.
This ACF field type is compatible with:
ACF 4 support is deprecated, and new plugin features will generally not work with ACF 4.
When outputting the link selection on the front end, you will have three object elements available:
Code example:
$mylink = get_field('mylink');
var_dump($mylink);
Outputs:
array(3) {
["url"]=>
string(31) "http://mysite.com/selected/url/"
["title"]=>
string(10) "Link Title"
["target"]=>
string(6) "_blank"
["postid"]=>
int 2231
}