Allow coauthors_wp_list_authors
to only query authors with posts
#496
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.
Fixes #193 by introducing
authors_with_posts_only
argument.The
$term_args
has been querying taxonomies withhide_empty => 0
for the past years, ignoring the value of$args['hide_empty']
that was passed to thecoauthors_wp_list_authors
function.A simple fix would have been to just let the
coauthors_wp_list_authors
use the value of$args['hide_empty']
but it defaults to true, and historically the term args defaulted to false, which is an inconsistency that's bound to cause trouble.In the future, maybe this function could be deprecated and a new function used instead with better defaults.
TL;DR: I decided to introduce
authors_with_posts_only
for backward compatibility of thehide_empty
argument.