Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#17717 closed defect (bug) (fixed)

Warning: join(): Invalid arguments passed in /home/wpcom/public_html/wp-includes/post-template.php on line 410

Reported by: westi Owned by: westi
Milestone: 3.2 Priority: normal
Severity: normal Version: 3.0
Component: Themes Keywords:
Focuses: Cc:


get_body_class takes an argument passed from body_class which can be a string or an array.

This argument is during the process of the function converted into an array in all cases except when it is empty - for example an empty string.

Themes sometimes use the body_classs function passing in the only body class they care about as a string or an empty string and then use a filter to return only this and not any of the default classes.

We should therefore make sure to convert an empty string into an array as well as a string containing one or more space separated classes.

Bug has always existed since this functionality was introduced for #11878.

Change History (1)

#1 @westi
7 years ago

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

In [18176]:

Ensure that we always coerce the class list passed to get_body_class to an array even when it is empty. Fixes #17717

Note: See TracTickets for help on using tickets.