Attach featured image to custom endpoints
To attach anything onto the results, you need to loop through each item and set the property on the object before you return it. You can do a for loop or an array_map() which essentially does a loop and sets the value for each item in the return array to what is returned by the … Read more