Hi- I’m using the link field as part of a custom navigation I needed to build out (using standard menus wasn’t going to cut it for the kooky design the creative team came up with)… The link field is great because it allows for selecting any piece of content within the site or external links, and offers a target option.
However, it’d be really handy if the return array [‘url’,’title’,’target’] also contained an object ID and type in the array..
Eg. if the linked item was a post, it could return ['url','title','target','type'=>'post','id'=>$post_id]
A custom post type could return ['url','title','target','type'=>$post_type_handle,'id'=>$post_id]
While a taxonomy archive could return ['url','title','target','type'=>$taxonomy,'id'=>$term_id]
Finally, an external link could return ['url','title','target','type'=>'external','id'=>null]
And so forth..
Maybe I’ll work on it myself and submit a PR for it.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users