added company based filter and user meta

This commit is contained in:
2026-02-17 10:55:50 +01:00
parent 9ea053986d
commit f505687b16
5 changed files with 117 additions and 3 deletions

View File

@@ -70,6 +70,15 @@ class Partnerexpo_Core_Public {
$params['tags'] = str_replace(',', '+', $params['tags']);
}
$companies = explode(',', $params['companies'] ?? '');
$authors = get_users([
'meta_key' => 'company',
'meta_value' => $companies,
'meta_compare' => 'IN',
'fields' => 'ID',
]);
$args = [
'post_type' => 'pexpo_partners',
'posts_per_page' => $params['resultsPerPage'] ?? 10,
@@ -79,6 +88,10 @@ class Partnerexpo_Core_Public {
'pexpo_tags' => $params['tags'] ?? '',
];
if (!empty($authors)) {
$args['author__in'] = array_values($authors);
}
if ( ! empty( $params['tags'] ) ) {
$tag_string = $params['tags'];
$operator = 'IN';