Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Author search by name #258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Author search by name #258

wants to merge 2 commits into from

Conversation

Juma7C9
Copy link

@Juma7C9 Juma7C9 commented Jun 30, 2024

Hi,
I expanded the search function allowing to use the author name as a filter, other than their ID.
As the infrastructure to do so is already largely in place, the only change is to split the author list and check each token to see if it is numeric or not, and recreate two lists - one for author IDs and one for author names.

This way inside the shortcodes is possible to specify any combination of author=1,3,42, author=J. Smith,Jane Doe, or author=1,Jane Doe,42, and the search will return all the publication that matches at least one of them (with partial matches for author names, as they are passed to a LIKE %name% clause).

This change is mostly backwards compatible, as lists of numeric author IDs in shortcodes are processed the same as before, while the functions TP_Authors::get_authors() and TP_Publications::get_publications() now return entries that matches at least one of those passed in author and author_id instead of both of them - but I'm not sure if is was ever possible to specify both using publicly available functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant