[wp-trac] [WordPress Trac] #57011: wp_list_authors is broken in WordPress 6.1
WordPress Trac
noreply at wordpress.org
Sun Nov 6 04:20:07 UTC 2022
#57011: wp_list_authors is broken in WordPress 6.1
--------------------------+-----------------------------
Reporter: lifeboat | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 6.1
Severity: normal | Keywords: has-patch
Focuses: |
--------------------------+-----------------------------
The command $result =
wp_list_authors('exclude_admin=0&optioncount=1&echo=0'); doesn't work in
WordPress 6.1. The problem happens as soon as an author with 0 posts is
reached. The exact error is: PHP Fatal error: Uncaught Error: Object of
class stdClass could not be converted to string in /var/www/html/blog/wp-
includes/author-template.php:568
I fixed this by adding a new line after $posts = isset( $post_counts[
$author_id ] ) ? $post_counts[ $author_id ] : 0; (Which is at line 497.)
New line: if (!is_scalar($posts)) {$posts = 0;}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57011>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list