Skip to content

Commit

Permalink
fix: author association earch and co-author search
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimds committed Nov 8, 2023
2 parents f72ef4a + 37924cc commit a172769
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/app/themes/awasqa/src/authors.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,7 @@ function get_translated_author_bio($author_id, $lang = null)
$translations = icl_get_string_translations_by_id($string_id[0]);
return $translations[$lang]['value'] ?? $description;
}

add_filter('coauthors_edit_author_cap', function ($capabilities) {
return 'read';
});
9 changes: 9 additions & 0 deletions web/app/themes/awasqa/src/carbon-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,12 @@ function add_user_to_organisation($org_id, $user_id)

\Carbon_Fields\Carbon_Fields::boot();
});

add_filter('carbon_fields_association_field_options_members_user', function ($args) {
$search_term = $args['search'] ?? '';
if (!$search_term) {
return $args;
}
$args['search'] = '*' . $search_term . '*';
return $args;
});

0 comments on commit a172769

Please sign in to comment.