Make WordPress Core

Opened 21 years ago

Closed 20 years ago

Last modified 20 years ago

#2384 closed defect (bug) (fixed)

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

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

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 (1)

if_authors_is_array_test.patch​ (608 bytes ) - added by MichaelH 21 years ago.
fix for template-functions-author.php

Download all attachments as: .zip

Change History (5)

@MichaelH
21 years ago

fix for template-functions-author.php

#1 @davidhouse
21 years ago

  • Keywords bg|has-patch added

#2 @westi
21 years ago

  • Component General → Template
  • Keywords wp_list_authors added
  • Milestone → 2.1
  • Priority low → normal

#3 @ryan
20 years ago

  • Resolution → fixed
  • Status new → closed

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

#4 @ryan
20 years ago

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

Note: See TracTickets for help on using tickets.