• Resolved rendermouse

    (@rendermouse)


    I am trying to set up a REST API (similar to this: https://www.ads-software.com/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.

Viewing 1 replies (of 1 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your question and for taking the time to find and adapt the earlier support topic.

    You wrote “(I did have to add some is_array() checks in the mla_query_posts_search_filter)“. If you can show me what you’ve done I may be able to update the plugin code in a future MLA version. You can contact me at my web site and send details via email.

    Taxonomy term assignments and custom field values are not returned in the mla_query_list_table_items() results. As the function name implies, the function is designed to support the Media/Assistant submenu table. These values are handled in another part of the code, the MLA_List_table::column default() function in class-mla-list-table.php. You could adapt the code in that function to post-process the query results and add the term assignments.

    I regret the news is not better, but I am marking this topic resolved because your question has been answered to the best of my ability. If you have any problems or further questions regarding the code adaptation I suggested, please post an update and I will give you what help I can. Thanks for your interest in the plugin.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.