Thanks for your question. Here is a solution that combines a dropdown to select a category with a keyword text search. This solution uses an MLA Example plugin to simplify the parameters and to make the dropdown and text box “sticky”, i.e., retain the entered values when the page refreshes.
This is a simplified version of a solution developed for an earlier topic:
MLA Text widget search and tag cloud
To install the example plugin, navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “elements” in the text box and click “Search Plugins” to filter the table.
You are looking for the “MLA UI Elements Example” plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and activate the example plugin as you would any other plugin. Make sure you have the latest version, 2.06, installed.
Once you have the example plugin installed and activated you can add this code to a “Custom HTML” or Code block in your post/page:
<form id="mla-search-form" action="." method="post">
Att. Category:
[mla_term_list]
taxonomy=attachment_category minimum=1 post_mime_type=image
mla_output=dropdown mla_control_name=att_category
mla_option_value="{+slug+}" use_filters=true
option_all_text='Select a category' option_all_value=ignore.terms.assigned
[/mla_term_list]
<br />
Keyword(s): [muie_keyword_search]
mla_search_fields='title,excerpt,content'
mla_search_connector='OR'
[/muie_keyword_search]
<br />
Items per page: [muie_per_page numberposts=4]
<br />
<input id="search-form-submit" name="search_form_submit" type="submit" value="Filter">
</form>
<h3>Gallery</h3>
[mla_gallery add_filters_to=any default_empty_gallery=true post_parent=all posts_per_page=4 mla_output="paginate_links,prev_next"]
[mla_gallery add_filters_to=any default_empty_gallery=true post_parent=all posts_per_page=4 mla_caption="{+title+} : {+description+}" mla_nolink_text="Enter tag(s) and/or keyword(s) to display the gallery."]
The above solution searches the Title, Caption and Description fields of each item. If you want to “search images by caption”, use mla_search_fields='excerpt'
.
You wrote that you are using a checklist, but you want to “search just images with a category applied“. I haven’t been able to get a multiple category selection to work, but if that’s vital I can investigate further.
I am marking this topic resolved, but please update it if you have problems or further questions regarding the solution outlined above. Thanks for your interest in MLA.