Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5143 closed defect (bug) (fixed)

Add new sitewide messages widget & check for active widget in bp_legacy class

Reported by: hnla's profile hnla Owned by: boonebgorges's profile boonebgorges
Milestone: 1.9 Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch dev-feedback
Cc:

Description

Patch adds new widget to display sitewide messages in sidebars.

Adds a check on is_active_widget('bp_core_sitewide_messages_widget')
to wrap:
add_action( 'wp_footer', array( $this, 'sitewide_notices' ), 9999 );
in class BP_legacy

If widget is active we don't render messages via wp_footer.

My widget class pretty much matches other BP ones but may need adjustments / checking over.

The add_action to register widget is wrapped in a check for bp_is_theme_compat_active() to prevent the widget being provided in themes running bp-default as it already has messages hardcoded to the main sidebar.

Tested to work as expected for twentytwelve / bp-default themes, single site.

This patch prompted by part of the discussion on #4802.

Attachments (2)

5143-01.patch (3.4 KB) - added by hnla 11 years ago.
Adds new messages widget & checks for acvtive widget.
5143-02.patch (3.2 KB) - added by hnla 11 years ago.
Remove check for theme_compat active to prevent widget loading on bp-default

Download all attachments as: .zip

Change History (6)

@hnla
11 years ago

Adds new messages widget & checks for acvtive widget.

@hnla
11 years ago

Remove check for theme_compat active to prevent widget loading on bp-default

#1 @hnla
11 years ago

02 patch removes attempt at preventing widget registering if theme is bp-default, what looked to work in first instance and test failed and wasn't able to find another approach, needs other eyes on it.

#2 @DJPaul
11 years ago

  • Keywords needs-patch dev-feedback added
  • Milestone changed from Awaiting Review to 1.9

Good start. Let's put this in the 1.9 milestone and get it finished.

I wouldn't worry about (not) supporting BP-Default here; I see your logic, but it's harmless enough and relatively easy for the user to modify their copy of BP-Default child theme, or just not use the widget.

#3 @hnla
11 years ago

I wouldn't worry about (not) supporting BP-Default here; I see your logic, but it's harmless enough and relatively easy for the user to modify their copy of BP-Default child theme, or just not use the widget.

Agreed, think I was simply over thinking things, bp-default users choose to use widget or not, choose to modify/create new sidebars or not, widget simply provides further options for dtheme users.

#4 @boonebgorges
11 years ago

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

In 7430:

Introduce Sitewide Notices widget

This widget allows the administrator to display sitewide notices in a sidebar.
When enabled, the automatic sitewide notices overlay is turned off.

Fixes #5143

Props hnla

Note: See TracTickets for help on using tickets.