### Description When trying to access a link field with the Element API, no data is returned that is usable. What I get instead is: urlSuffix | null target | null title | null class | null id | null rel | null ariaLabel | null download | false Has this been added when the link field was added to Craft? ### Additional info - Craft version: 5.10.3 - PHP version: 8.2
Activity
linear-code commentedon Jun 9, 2026
PT-3141
Fill in the gaps when converting a LinkData object to an array
brandonkelly commentedon Aug 5, 2026
That’s just the default array representation of
craft\fields\data\LinkDataobjects, based on the class’s public properties.You can fetch additional values by calling their public methods directly. For example, if all you want is the resulting URL, you could do:
Or if you want additional info from
LinkData:That said, I’ve updated
LinkDatato automatically include several new values when it’s converted to an array, for Craft 5.11:typevalueurllabelfilenamelinkattributesdefaultLabelelementTypeelementIdelementSiteIdelementTitlebrandonkelly commentedon Sep 1, 2026
Craft 5.11.0 is out with that change.