Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 4 weeks 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 12 years ago.

Download all attachments as: .zip

Change History (3)

#1 @ryan
12 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

This ticket was mentioned in Slack in #core-editor by nrqsnchz. View the logs.

4 weeks ago

Note: See TracTickets for help on using tickets.