Move masthead banner settings to Template Settings sidebar - #338
Move masthead banner settings to Template Settings sidebar#338RachelRVasquez wants to merge 28 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR moves page-level masthead banner controls (show/hide banner, hide breadcrumbs) out of the legacy page-banner metabox into the block editor “Template Settings” sidebar, and adds a new per-page setting to center-align masthead content (including optional icon/title composition). It also reorganizes associated SCSS so masthead/landing-page overrides live in more appropriate partials.
Changes:
- Adds new editor sidebar controls and registers the related page post meta in REST (including a new
_memberlite_banner_text_alignmentsetting). - Refactors masthead rendering to support centered alignment and extracts icon markup generation into a helper.
- Moves masthead-related styles out of shortcodes SCSS into masthead/page SCSS partials.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scss/structure/_masthead.scss | Adds masthead layout rules for new centered/row icon+title structures and relocates banner-hidden spacing rule. |
| src/scss/pages/_page.scss | Relocates landing-template masthead overrides into the page stylesheet. |
| src/scss/components/_shortcodes.scss | Removes masthead-related styling from the shortcodes component stylesheet header/section. |
| src/editor/custom-settings.js | Adds sidebar controls (banner toggle, breadcrumb toggle, text alignment) under “Template Settings”. |
| js/admin-page_banners.js | Removes legacy metabox show/hide toggle JS for banner settings. |
| inc/page_banners.php | Removes banner show/hide + breadcrumbs controls from metabox save flow; adds alignment-aware masthead rendering and icon helper; updates banner render decision logic. |
| inc/extras.php | Updates breadcrumbs rendering gate to respect _memberlite_banner_hide_breadcrumbs meta more flexibly. |
| inc/editor-settings.php | Registers new page post meta for banner visibility, breadcrumb visibility, and text alignment; passes global breadcrumb setting to editor script. |
| components/header/header-masthead.php | Applies centered alignment class to masthead wrapper based on per-page meta. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
15050a5 to
3156fb1
Compare
flintfromthebasement
left a comment
There was a problem hiding this comment.
PR: #338 — Move masthead banner settings to Template Settings sidebar
RachelRVasquez → starter-sites | 9 files, +210 -181
#338
Summary
Solid refactor — moving the show/hide-breadcrumbs/alignment controls into the block editor sidebar, restricting the new meta keys to page, and cleaning out the deprecated "banner right" feature are all done consistently. One real visual regression on the masthead icon needs a fix before merge; everything else is minor.
Issues
-
[Major]
inc/page_banners.php:370— The left-aligned icon wrapper changed from<div class="medium-1 columns text-center">to<div class="medium-1 columns masthead-icon">..text-center(src/scss/base/_utilities.scss:30) appliedtext-align: center, which horizontally centered the icon glyph in its narrow column..masthead-iconhas no matching rule anywhere insrc/scss/— I checked the full tree at this head commit. The newalign-items: centeron.memberlite_elements-masthead(src/scss/structure/_masthead.scss) only affects flex cross-axis (vertical) alignment, nottext-align. Net effect: pages with a banner icon and left/default text alignment will show the icon left-aligned instead of centered — a visible regression from current production. Addtext-align: centerto.masthead-iconin_masthead.scss. -
[Minor]
inc/extras.php:263—if ( $memberlite_banner_show === '0' || ! $memberlite_banner_show ).'0'is already falsy in PHP, so=== '0'is fully subsumed by! $memberlite_banner_showand adds nothing. Simplify toif ( ! $memberlite_banner_show ) {(also drop the stray double space before!). -
[Minor]
src/editor/custom-settings.js:37-38—showBannerValueandhideBreadcrumbsValueread straight offmeta?._memberlite_banner_show/meta?._memberlite_banner_hide_breadcrumbswith no fallback, unlike every other toggle in this file (hideHeaderValue,hideFooterValue,stickyValueall use|| false). Before the entity record resolves,metacan be undefined, so these twoToggleControls can briefly renderchecked={undefined}— React will warn about a controlled/uncontrolled switch. Match the existing convention, e.g.meta?._memberlite_banner_show ?? true. -
[Minor / worth confirming]
inc/page_banners.php— The classic metabox no longer renders any control for_memberlite_banner_show,_memberlite_banner_hide_breadcrumbs, or_memberlite_banner_text_alignment, andmemberlite_settings_save_meta_box_data()no longer reads their$_POSTvalues. These are now editable only through the Gutenberg sidebar panel. If any site running this theme still edits pages with the Classic Editor plugin, there's no UI path left to change these settings. Worth confirming this is an accepted trade-off — it isn't called out in the test plan. -
[Trivial]
inc/editor-settings.php:218— Diff shows\ No newline at end of file; the file lost its trailing newline.
Looks Good
memberlite_get_masthead_icon_html()switching to the[fa]shortcode also fixes a pre-existing bug: the old code treated the icon-select placeholder'blank'as a real icon (! empty( $memberlite_page_icon )is true for'blank'), rendering an empty icon wrapper.$show_masthead_iconnow explicitly excludes'blank'.register_post_meta( 'page', ... )plus theget_post_type() === 'page'guard inmemberlite_should_masthead_render()correctly scope the new settings to pages only, and default handling is sound — since these meta keys register adefault,get_post_meta()correctly returns that default (true/false) rather than an empty string when a page has never been touched, so untouched pages still show the masthead.- The breadcrumb hide check now handles both the legacy
'1'string and the new booleantruefrom REST saves — good backward compatibility. - Removing the dead
$show_breadcrumbs/$profile_breadcrumbslocals inmemberlite_get_breadcrumbs()is correct cleanup; that variable was never used after assignment.
Questions
- Is dropping the classic-editor UI for these three settings (see Minor above) intentional, or should there be a metabox fallback for non-block-editor workflows?
- Was the left-aligned icon regression (Major finding) caught in manual QA, or did testing focus on the new centered-alignment variant?
|
Responding to Flint's Feedback:
I checked again and compared my branch to Memberlite 6.1 from a few versions ago, and from what I'm seeing, yes, that
Since
This is intentional. Detailed explanation here: #338 (comment)
We've already done this with other settings we've deprecated from the metabox and moved to the sidebar. So this is probably okay, but I'll confirm whether we support the Classic Editor plugin. |
flintfromthebasement
left a comment
There was a problem hiding this comment.
Follow-up review
PR: #338 — Move masthead banner settings to Template Settings sidebar
RachelRVasquez → starter-sites | 9 files, +209 -180
#338
Summary
Delta since my last pass is just the trailing-newline restore in editor-settings.php — no functional code changed. All of my prior points have been answered by the author; two hold up, two don't fully. Nothing new or blocking. Still a COMMENT-level PR, ready to merge once the two open Minor items below are addressed (or explicitly waived).
Prior issues — status
-
Masthead icon left-align regression (
inc/page_banners.php:370,.text-center→.masthead-icon) — Pushed back, and I'll concede it. You compared against 6.1 and showed a screenshot with.text-centerremoved entirely looking identical — the narrowmedium-1column's padding plus the large icon glyph (size="4x"inmemberlite_get_masthead_icon_html()) apparently leaves little room fortext-alignto matter. That's real QA evidence, not theory, so I'm downgrading this off the blocking list. One thing worth a quick check since it wasn't in the screenshot:templates/narrow-width.phprenders the icon atsize="2x"(inc/page_banners.php:313) — a smaller glyph in the same column has more slack, so the same regression could still show up there even if it doesn't at 4x. Worth a 30-second look before calling this fully closed. -
inc/extras.php:263—$memberlite_banner_show === '0' || ! $memberlite_banner_show— Holding the line, but downgrading to Trivial. Checked this directly:php -r 'var_dump((bool)"0");'→false. PHP does treat the string'0'as falsy in a boolean context —! "0"istrue— so=== '0'never adds a case that!$memberlite_banner_showdoesn't already catch. This isn't the "string vs boolean" gap you're describing; that gap is real for other values (''from REST, unset returning the registered default) but'0'isn't one of them since it's already falsy. No behavior changes if you simplify toif ( ! $memberlite_banner_show ) {— pure redundancy, not a bug, and I won't hold the PR on it. -
src/editor/custom-settings.js:37-38— no fallback onshowBannerValue/hideBreadcrumbsValue— Partially addressed / still open on the actual fix. Your explanation (and Copilot's independent flag on the same line) both correctly note that|| falsewould be wrong forshowBannerValuesince the registered default istrue(inc/editor-settings.php:87) — agreed,||can't tell "never set" apart from "explicitly off." But that's not what I suggested.??(nullish coalescing) checks only fornull/undefined, not falsiness — someta?._memberlite_banner_show ?? trueresolvesundefined(mid-load) totruewithout touching an explicitly-savedfalse/''/'0'. That's the fix that satisfies your own constraint. ForhideBreadcrumbsValuethe registered default isfalse, so it doesn't have this asymmetry at all —|| false, matching the other toggles, is fine there and removes the transientchecked={undefined}warning during load. -
Classic editor UI removal (
inc/page_banners.php) — Acknowledged, not yet confirmed. You said you'll check whether Classic Editor plugin support is expected; no update yet. Not blocking, just don't let it fall off before merge. -
inc/editor-settings.php:218trailing newline — Resolved. Confirmed in the diff.
New findings since last review
None — the only change in this range is the newline fix above.
Questions
- Did you check the narrow-width template's
2xicon rendering for the same left-align comparison, or only the default4xsize? - Any update on Classic Editor support for these three settings?
|
More Flint follow-up:
I did. The
Following up on this internally. |
533ea60 to
41b9eeb
Compare
…crumbs - we'll need this for the editor JS
…ender masthead and breadcrumbs to expect legacy or true/false values, removed fields from the sidebar/metabox, still testing
…an empty string on a page for the banner post meta is not treated the same on a post, empty on a post means show banner, empty on a page gets translated as falsey and hides the banner. Also removed JS for toggling metabox banner fields I've removed. Breadcrumbs look like they're working okay on posts and pages.
…pply to breadcrumbs, page title, and description. Needs more testing
…tion the icon so we can center it, not going well, revert
…red some extra conditionals, still testing
…ts, there's a 'blank' value when no icon is selected so we should consider that, not just 'empty'
… _masthead.scss or _pages.scss. Testing and tweaking as I compare desktop and mobile.
…e conditional I added in memberlite_should_masthead_render() is also checked in memberlite_body_classes()
…rom classic editor to block editor again
d6f0e09 to
46e4d25
Compare
flintfromthebasement
left a comment
There was a problem hiding this comment.
Follow-up review
PR: #338 — Move masthead banner settings to Template Settings sidebar
RachelRVasquez → starter-sites | 9 files, +209 -180
#338
Summary
Good progress — the left-align icon question is closed with real evidence, and Classic Editor support is now restored (my open question from last round). One issue I've now flagged three rounds running is still not fixed: the ?? fallback on showBannerValue. Nothing new is blocking; still COMMENT-level.
Prior issues — status
-
Masthead icon left-align regression — Resolved.
header-masthead.phpnow only addstext-centerwhen_memberlite_banner_text_alignment === 'centered'($masthead_classes = $is_page_masthead_centered ? 'masthead text-center' : 'masthead';), and the centered layout uses an explicit flex wrapper (.memberlite_elements-masthead-centered,_masthead.scss) instead of relying on inheritedtext-align. Per the thread, you also checked the narrow-width2xicon and confirmed the mobile centering is now an intentional design choice (left stays left, center centers everything), not an accidental regression. Closing this out. -
inc/extras.php:263redundant=== '0' || !$xcheck — Not addressed, still Trivial. Unchanged since I downgraded it last round — not worth holding the PR on. -
src/editor/custom-settings.js— no??fallback onshowBannerValue/hideBreadcrumbsValue— Still not addressed. Current code:const showBannerValue = meta?._memberlite_banner_show; const hideBreadcrumbsValue = meta?._memberlite_banner_hide_breadcrumbs;
This is the third round I've flagged this. To recap the actual fix (not
||, which you correctly noted breaks thetrue-default case):meta?._memberlite_banner_show ?? trueresolvesundefined(before the entity record loads) totruewithout touching an explicitly-savedfalse.hideBreadcrumbsValuehas no such asymmetry (default isfalse), someta?._memberlite_banner_hide_breadcrumbs || falseis fine there and matches the other toggles in the file. As-is, bothToggleControls renderchecked={undefined}on first paint, which can visibly flash the "Show Masthead Banner" toggle off before flipping on, plus a React controlled/uncontrolled console warning. Low severity but trivial to fix and now overdue. -
Classic editor UI removal — Resolved.
page_banners.phpnow gates the metabox fields with the newmemberlite_is_block_editor()helper — classic editor still gets the radio/checkboxes, block editor gets a pointer to the sidebar panel instead.js/admin-page_banners.jsalso correctly no-ops when the radio doesn't exist. Good fix.
New findings
-
[Minor]
functions.php—memberlite_is_block_editor():function memberlite_is_block_editor() { $current_screen = get_current_screen(); return method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor(); }
get_current_screen()returnsnulloutside a set admin-screen context (e.g. a REST-drivensave_postfrom the block editor's own autosave, or a CLI/cron-triggered save).method_exists( null, 'is_block_editor' )doesn't fatal, but passingnullto a non-nullable internal parameter throws a deprecation notice on PHP 8.1+. Guard with$current_screen instanceof WP_Screen && $current_screen->is_block_editor()instead. Low risk since theisset($_POST[...])guards inmemberlite_settings_save_meta_box_data()prevent any actual bad write, but it'll spam the PHP log on REST saves. -
Unrelated changes in this diff —
functions.php(memberlite_dedupe_editor_color_palette→memberlite_clean_editor_color_palette, now curating against a hardcoded allowlist of ~15 slugs instead of deduping by color value),inc/colors.php(hex value changes for Deep Harbor/Cocoa Ash/Gotham/Rosewood), andstructure/_header.scss(removal of the.scheme_cocoa_ashcolor-mix workaround, consistent with the Cocoa Ash primary color now being lighter) all showed up in this diff range but have nothing to do with masthead banner settings. This looks like a rebase pulling in commits from an updatedstarter-sitesbase rather than something you added to this PR — worth confirming so it's not accidentally double-reviewed or double-merged elsewhere.
Questions
- Can you confirm the color-palette/hex changes (
functions.php,inc/colors.php,_header.scss) landed here via a rebase offstarter-sites, not as new work on this branch?
flintfromthebasement
left a comment
There was a problem hiding this comment.
Follow-up review
PR: #338 — Move masthead banner settings to Template Settings sidebar
RachelRVasquez → starter-sites | 10 files, +272 -155
#338
Summary
Both outstanding items from my last pass are now fixed correctly. Nothing new is wrong. Approving.
Prior issues — status
-
functions.php—memberlite_is_block_editor()null-screen deprecation notice — Resolved. Nowreturn $current_screen instanceof WP_Screen && $current_screen->is_block_editor();.instanceofonnullis safe (returnsfalse, no notice), so this correctly avoids the PHP 8.1 deprecation I flagged from passingnullintomethod_exists()'s second-argument-adjacent call pattern. -
src/editor/custom-settings.js— no??fallback onshowBannerValue(flagged 3 rounds running) — Resolved. Nowmeta?._memberlite_banner_show ?? truewith an inline comment explaining the??vs||distinction, andhideBreadcrumbsValueuses|| false(correct, since its default isfalseand has no asymmetry). This is exactly the fix I'd been asking for — verified against the diff, nochecked={undefined}case remains on first paint. -
Unrelated color-palette/hex changes (
functions.php,inc/colors.php,_header.scss) I flagged as a possible rebase artifact — Withdrawing, my error. I re-diffed this PR branch against a freshly-fetchedupstream/starter-sitesmerge-base (5c3bd50) and neitherinc/colors.phpnorstructure/_header.scssappear in the diff at all — the current 10-file diff isfunctions.php,inc/editor-settings.php,inc/extras.php,inc/page_banners.php,js/admin-page_banners.js,src/editor/custom-settings.js,components/header/header-masthead.php, and the three_shortcodes.scss/_page.scss/_masthead.scssfiles (the masthead SCSS reorg, which is legitimately part of this PR's scope). The color-palette diff I reported last round was against a stale localstarter-sitescheckout on my end that hadn't picked up those already-merged upstream commits — not something in your branch. Sorry for the noise; no action needed on your side. -
inc/extras.php:263redundant=== '0' || !$x— Still open, still Trivial. Unchanged, not worth holding the PR on.
New findings
None — the delta since my last review is exactly the two fixes above.

All Submissions:
Changes proposed in this Pull Request:
Note: We are supporting the Classic Editor plugin by detecting whether the block editor is active. When the Classic Editor plugin is on, our "Template Settings" in the sidebar are not there so the metabox settings need to remain for those users.
memberlite_body_classesandmemberlite_should_masthead_renderfunctions to take both the legacy values and the new strict true/false state into account. Conditionals updated in both functions.page_banners.phpso we can easily change the masthead's content alignment (left/center)._shortcodes.scssto_masthead.scssand_pages.scssinstead.ℹ️ Note: Build files are intentionally excluded from this PR.
How to test the changes in this Pull Request:
Other information:
Changelog entry