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: |
|
Owned by: |
|
---|---|---|---|
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)
Change History (6)
#1
@
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
@
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
@
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.
Adds new messages widget & checks for acvtive widget.