Fallback to default sidebar behavior when forum sidebar is not configured#306
Draft
RachelRVasquez wants to merge 1 commit into
Draft
Fallback to default sidebar behavior when forum sidebar is not configured#306RachelRVasquez wants to merge 1 commit into
RachelRVasquez wants to merge 1 commit into
Conversation
…o default sidebar behavior instead of rendering no sidebar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Bug: bbPress pages show empty sidebar column when no forum CPT sidebar is configured
Problem
On bbPress forum pages, the sidebar column would render visibly in the layout (respecting the Customizer layout settings) but contain no widgets.
The cause was in
memberlite_get_widget_areas()ininc/sidebars.php. For bbPress pages, the function unconditionally replaced the default widget areas with the result ofmemberlite_get_default_sidebar_by_post_type( 'forum' ):When no forum-specific CPT sidebar had been configured in Memberlite → Custom Sidebars, that function returns
false, resulting in$widget_areas = array( false ). Callingdynamic_sidebar( false )renders nothing, leaving the sidebar column empty even though the layout expected content there.Fix
Guard the override so it only applies when a valid forum CPT sidebar is actually configured. If none is set (or the value is the
'memberlite_sidebar_default'sentinel),$widget_areasis left unchanged, falling back tosidebar-2(Posts & Archives) as it would for any other non-page, non-blog context.Behavior After Fix
sidebar-2memberlite_sidebar_defaultsidebar-2How to test the changes in this Pull Request:
Other information:
Changelog entry