WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 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:

Description

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 5 years ago.

Download all attachments as: .zip

Change History (2)

Denis-de-Bernardy5 years ago

comment:1 ryan5 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.