As a contrib module, I want to provide a list of fields on my admin settings form. I have the field machine names, but in order to provide a better user experience, I'd like to provide the human-readable names instead.
I'd like a helper function, something like field_get_label() that would provide the most commonly used label across all instances. I'd also like the matching field_get_labels() that would provide me with a list of all labels for that field, perhaps keyed by bundle name.
edit: The latest PR also includes a field_get_all_labels() to get labels for more than one field at a time.
I've done a crazy loop-de-loop in the nodequeue module to get the field labels, but would prefer to have something in core so that every contrib module does not need to do the same.
I expect that if contrib developers are faced with this much work to get a field label, they are likely to print the machine name instead, and be done with it. By providing a utility function we decrease the burden on our contrib developers and are also likely to create a better experience for our end users!
Recent comments
Update: I tried to use Leaflet and Geofield with Geocoder, but can't get geocoding from other field working at all. But at no point the map breaks. It just stays empty. Is there really,...
Disappearing administration bar. Is this a Leaflet or a Backdrop bug?
To me this clearly looks like some wrong use of the Leaflet library at some point. But the problem is not the empty map (alone), which works fine and never caused me trouble. Something...
Disappearing administration bar. Is this a Leaflet or a Backdrop bug?
Clearing the cache was one of the things I tried. This included truncating the cache tables that don't get cleared by the flush all caches button, as well as sessions and tempstore tables. This...
Disappearing administration bar. Is this a Leaflet or a Backdrop bug?