Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#9457 closed defect (bug) (fixed)

get_body_class() breaks the loop_start and loop_end hooks

Reported by: Denis-de-Bernardy Owned by:
Milestone: 2.8 Priority: high
Severity: blocker Version: 2.8
Component: Template Keywords: has-patch tested commit
Focuses: Cc:


I've a couple of plugins that rely on loop_start and loop_end to start and end an output buffer to re-do the full loop with different formatting.

In its current implementation, get_body_class() triggers loop_start without triggering loop_end, you end up "in the loop" until the actual loop ends. And my plugins end up haplessly spewing their content in the body tag on the default WP theme.

The attached patch makes get_body_class() return the same results without wrecking havoc all over the place.

Attachments (1)

9457.diff (1.6 KB) - added by Denis-de-Bernardy 9 years ago.

Download all attachments as: .zip

Change History (2)

#1 @ryan
9 years ago

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

(In [10877]) Don't trigger loop start in get_body_class(). Props Denis-de-Bernardy. fixes #9457

Note: See TracTickets for help on using tickets.