Ticket #2384 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Warning: Invalid argument supplied for foreach() in wp-includes/template-functions-author.php on line 182

Reported by: MichaelH Assigned to: anonymous
Priority: normal Milestone: 2.1
Component: Template Version: 2.0
Severity: trivial Keywords: bg|has-patch wp_list_authors
Cc:

Description

Warning: Invalid argument supplied for foreach() in wp-includes\template-functions-author.php on line 182

Error happens using wp_list_authors() when only admin user is defined. Default usage of wp_list_authors() causes admin user to be excluded and that causes the error.

If I did this right, the attached fix checks to see if $authors is an array.

Attachments

if_authors_is_array_test.patch (0.6 kB) - added by MichaelH on 02/03/06 22:19:08.
fix for template-functions-author.php

Change History

02/03/06 22:19:08 changed by MichaelH

  • attachment if_authors_is_array_test.patch added.

fix for template-functions-author.php

02/03/06 23:18:01 changed by davidhouse

  • keywords set to bg|has-patch.

02/04/06 07:48:39 changed by westi

  • keywords changed from bg|has-patch to bg|has-patch wp_list_authors.
  • priority changed from low to normal.
  • component changed from General to Template.
  • milestone set to 2.1.

11/19/06 08:05:47 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [4496]) Handle empty authors list. Props MichaelH. fixes #2384

11/19/06 08:06:05 changed by ryan

(In [4497]) Handle empty authors list. Props MichaelH. fixes #2384