Skip to:
Content

Opened 10 years ago

Closed 9 years ago

#987 closed defect (bug) (fixed)

body_class is meaningless for non-blog pages in bp_get_the_body_class

Reported by: junsuijin Owned by: junsuijin
Milestone: 1.1 Priority: trivial
Severity: Version:
Component: Keywords: has-patch, tested
Cc:

Description

body_class returns the same data for every buddypress page (non-blog pages). These wp classes pertain to the most recent blog post, and are therefore incorrect or meaningless for buddypress pages.
The attached patch is one fix for this condition.

Attachments (4)

bp_get_the_body_class-fix.patch (555 bytes) - added by junsuijin 10 years ago.
simpler, cleaner
bp_get_the_body_class-fix.2.patch (555 bytes) - added by junsuijin 10 years ago.
simpler, cleaner, double-attach due to whitespace removal
bp_get_the_body_class-fix.3.patch (1.3 KB) - added by junsuijin 10 years ago.
cleaned again, takes user-added classes into account
bp_get_the_body_class-fix.4.patch (1.3 KB) - added by junsuijin 10 years ago.
slightly better revision, avoids unnecessary double-setting of $wp_classes

Download all attachments as: .zip

Change History (8)

#1 @junsuijin
10 years ago

Was tired/not thinking when I made the first patch here. This second patch is much better.

@junsuijin
10 years ago

simpler, cleaner

@junsuijin
10 years ago

simpler, cleaner, double-attach due to whitespace removal

#2 @apeatling
10 years ago

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

(In [1824]) Fixes #987 props junsuijin

#3 @junsuijin
10 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

My previous fix was again, too hasty. This fix allows body_class('anything can go here') to be preserved even when not on a blog page, while still eliminating the meaningless body_class elements on non-blog pages.

@junsuijin
10 years ago

cleaned again, takes user-added classes into account

@junsuijin
10 years ago

slightly better revision, avoids unnecessary double-setting of $wp_classes

#4 @apeatling
9 years ago

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

(In [1939]) Fixes #1061, #987

Note: See TracTickets for help on using tickets.