I'm building a Vue/NuxtJS portfolio site that will hopefully use WordPress as a headless CMS. I've been searching for hours but can't seem to come to a definitive solution.
I know it's possible to organize the media library into folders through various plugins. I also know I can use something like ACF to add additional fields (although I'm not sure if ACF works with the media library). There are essentially two endpoints I need, and I'm not sure if it's possible since Wordpress removed the filter parameter from the API.
- Retrieve all folders and its cover image for the gallery index. For example, if there are four folders I've created in the media library, I'd like the endpoint to return an array of four objects that return folder title and cover image. The endpoint might look something like
/wp-json/wp/v2/media/folders
. - Retrieve all images and size variations of those images for a specific folder. For example, if a user clicks into a specific gallery to see all of the images in that gallery. If a user clicks on a specific image, a Lightbox pops up to display a full-size version of that image. The endpoint might look something like
/wp-json/wp/v2/media/folders/1
.
I would greatly appreciate any guidance or suggestions anyone could provide!