Support

Account

Home Forums Feature Requests add object/ID to link field return array?

Unread

add object/ID to link field return array?

  • 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.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.