Tag Archives: wp_list_authors

List Authors Version 2.0 Released

Today I released version 2.0 of the List Authors WordPress widget. The underlying code has in fact existed for quite some time in the form of a patch submitted to WordPress to enhance the abilities of the wp_list_authors template tag. My hope was that the patch would make it into version 3.0 of WP after which I could update my widget to use it. That never happened so I have instead added a custom version of the wp_list_authors function to List Authors plugin.

After several months of tweaking and re-tweaking my patch in response to comments from various WP devs, I was confident that the patch was production-ready. The feature request has been open for over a year with a working patch for six months–at this point, I doubt it will ever be released. Maybe there are legitimate performance concerns with the patch (there aren’t any problems I’m aware of), or maybe the features are just too low in priority. The patch was my attempt at contributing back to an open-source project. After this experience, I have to say I’m a bit disappointed in the whole process. Maybe I’ll try my hand at it again, but it will be with a project other than WordPress.

In the meantime, I hope those using my List Authors widget enjoy the new features of version 2.0.

Enhance WordPress wp_list_authors Template Tag

As can be seen by some of the comments left on the site, a couple of frequently requested features cannot be added to the List Authors widget because they are not supported by the underlying wp_list_authors template tag. The WordPress code for wp_list_authors needs to be changed to enable these new features.

Feature 1: Allow an upper limit to the number of authors listed. Some WordPress sites have hundreds or even thousands of contributors. wp_list_authors currently would list all of them and, worse, execute an SQL statement for each author. The proposed fix could be a non-negative integer option named “count_limit.”

Feature 2: Allow sorting of the author list. This could be an option named “sort_by” with the values “name” and “post_count.”

Today I submitted a patch to WordPress Trac including both of the above features. It also changes the code to use a JOIN statement to get the author post count instead of running an SQL statement for every author. This was a necessity to prevent inconsistencies when applying the LIMIT and ORDER BY. One of the core developers is reviewing it now and, if I’m lucky, the change will be included in the next major release (version 3.0). If that happens, you can be sure I will be updating the List Authors widget to make use of the new options.

A less frequent request but one I’ve seen is for an “exclude” option with the ability to filter out certain categories of authors. There is a separate ticket for this and I might consider submitting a patch for this next.