Opened 6 years ago

Closed 6 years ago

#3556 closed defect (bug) (fixed)

warning generated by _pad_category_counts() when no posts

Reported by: dougal Owned by: anonymous
Priority: normal Milestone: 2.1
Component: Template Version: 2.1
Severity: normal Keywords:
Cc:

Description

If there are no posts in the db, _pad_category_counts() generates a warning due to a foreach over an empty array. Diff attached.

Attachments (1)

category.php.diff (520 bytes) - added by dougal 6 years ago.
fix empty foreach warning

Download all attachments as: .zip

Change History (3)

dougal6 years ago

fix empty foreach warning

Warning generated is:

Warning: Invalid argument supplied for foreach() in
/web/server/path/httpd.www/lions/wp-includes/category.php on line 297

comment:2   ryan6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4716]) Cast to array to avoid warning. fixes #3556

Note: See TracTickets for help on using tickets.