🖥️ wip: working on text search of taxonomy terms

This commit is contained in:
Keith Solomon
2025-01-30 15:49:24 -06:00
parent 851a40c1c0
commit c865441eb9
2 changed files with 107 additions and 10 deletions

View File

@@ -11,7 +11,17 @@ jQuery(document).ready(function ($) {
};
$.post(resourceFilterAjax.ajaxurl, formData, function (response) {
$('#resource-results').html(response);
response = JSON.parse(response);
$('#resource-results').html(response.html);
$('#result-count').text(response.count);
let filters = [];
if (response.filters.search) filters.push('Search: "' + response.filters.search + '"');
if (response.filters.resource_type) filters.push('Type: ' + $('#resource_type option:selected').text());
if (response.filters.resource_subject) filters.push('Subject: ' + $('#resource_subject option:selected').text());
$('#applied-filters').text(filters.length ? filters.join(', ') : 'None');
});
});
});