Posted: June 11, 2020 at 3:29 pm
I am unable to figure out how to use the REST API to add featured_media to an espresso_events post type.
I tried the wp endpoint using espresso_events as the custom post type (this is how it should work if espresso_events is a CPT):
I get this:
I also tried sending the featured_media param to the ee events REST API but that didn’t work – unsupported.
Is it possible to set a featured image on an event_espresso event using the REST API? If so, would you provide a pointer to code or a sample CURL call I can adapt?
Hmmm… I found this code shortly after posting this request. It allowed the first REST API request to work. I am now able to add a featured image using the featured_media json payload.
However, I wonder if this is the correct way:
There’s nothing wrong with using that method, it sets EE posts types to be available on the standard WP endpoints and as EE events are a custom post type you can use the usual parameters.