<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>Fetching images by tag via REST does not provide tagging data in the response

[ad_1]

Replies: 1

I am trying to set up a REST API (similar to this: https://projectdmc.org/support/topic/rest-api-to-get-media-by-taxonomy/) for fetching Media Library images tagged using attachment_tag.

My code calls mla_query_list_table_items() and passes in s=flowers&mla_search_fields=terms plus current_page and per_page params as a POST form-data request. (I did have to add some is_array() checks in the mla_query_posts_search_filter)

I get an array of data items that seem to match my tag taxonomy query, but there is no tagging taxonomy data included with the items (the mla_item_tags prop is coming back empty), so I do not know what OTHER tags might be attached to the images in my results set.

Am I missing something? How can I get the tags for each item to be populated in my data?

Thank you.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer