Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
, orauthor=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 aLIKE %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()
andTP_Publications::get_publications()
now return entries that matches at least one of those passed inauthor
andauthor_id
instead of both of them - but I'm not sure if is was ever possible to specify both using publicly available functions.