Skip to:
Content

#4375 closed defect (bug) (fixed)

custom-background body class stripped out of body classes

Reported by: wpmuguru Owned by:
Milestone: 1.6 Priority: normal
Severity: normal Version: 1.6-rc
Component: Core Keywords: has-patch
Cc:

Description

If you implement BP with a third party theme that uses the WP custom background feature, the theme has to filter the body class at a lower priority than BP and add the custom-background class back into the body classes array on the BP content areas.

Attachments (1)

4375.diff (577 bytes) - added by wpmuguru 21 months ago.

Download all attachments as: .zip

Change History (8)

wpmuguru21 months ago

comment:1 wpmuguru21 months ago

Also, there is no RC version to set this ticket to. The issue is still present in RC1.

comment:2 DJPaul21 months ago

  • Milestone changed from Awaiting Review to 1.6
  • Version changed from 1.6-beta to 1.6-rc

Moving to 1.6 for review. wpmuguru, do you know if this is a new bug in BP 1.6, or if it's present in BP 1.5.6?

comment:3 wpmuguru21 months ago

Yes it was in 1.5.X since WP 3.3 was released. Someone put in a support question on it & that's what reminded me to check and see if it had been fixed in 1.6.

comment:4 in reply to: ↑ description ; follow-up: DJPaul21 months ago

the theme has to filter the body class at a lower priority than BP and add the custom-background class back into the body classes array

I don't quite understand where you think BP removes the class, or what type of template it affects. Are we talking e.g. blog posts, or BuddyPress content pages?

Only thing I can see is the IF near the "preserve any custom classes already set" comment in bp_get_the_body_class() -- is this where the bug is?

comment:5 in reply to: ↑ 4 wpmuguru21 months ago

Replying to DJPaul:

I don't quite understand where you think BP removes the class, or what type of template it affects. Are we talking e.g. blog posts, or BuddyPress content pages?

The BuddyPress content pages.

Only thing I can see is the IF near the "preserve any custom classes already set" comment in bp_get_the_body_class() -- is this where the bug is?

custom-background is not passed through the $custom_classes. It's passed through $wp_classes which is ignored on the BP content pages by

		if ( !bp_is_blog_page() ) {

			// Preserve any custom classes already set
			if ( !empty( $custom_classes ) ) {
				$wp_classes = (array) $custom_classes;
			} else {
				$wp_classes = array();
			}
		}
Last edited 21 months ago by wpmuguru (previous) (diff)

comment:6 DJPaul21 months ago

Ok, thanks. Something like your patch makes sense then.

comment:7 djpaul21 months ago

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

(In [6198]) Don't remove .custom-background <body> class from BuddyPress content pages when using a theme which supports custom backgrounds. Fixes #4375, props wpmuguru for initial patch.

Note: See TracTickets for help on using tickets.