carbon-fields
carbon-fields copied to clipboard
Field Type: Link
I had a case where I needed a field to link to another page which couldnt be done in the richtext editor. While I found that Field Type "Association" solved my problem at first, I later had the thought "but what if I want to link to an external URL instead". Making a second field felt unintuitive (association element already takes up quite a bit of space), so what I did was create a custom post type with a URL field and added it to the association set_types array. For the output just catch the type and change output a little.
This works, however, I'd much rather have a wizard where you can directly decide between a URL or linking a post. Basically what tinymce and gutenberg editor have.