Footer customizer updates rb#247
Draft
RachelRVasquez wants to merge 10 commits intostrangerstudios:memberlite-footer-variationsfrom
Draft
Footer customizer updates rb#247RachelRVasquez wants to merge 10 commits intostrangerstudios:memberlite-footer-variationsfrom
RachelRVasquez wants to merge 10 commits intostrangerstudios:memberlite-footer-variationsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Memberlite’s footer system to support selecting and rendering footer “variations” from a memberlite_footer CPT, with Customizer controls for per-context selection and an editor override on pages, while retaining the legacy PHP footer as a fallback.
Changes:
- Added footer selection logic (Customizer context + per-page override) and server-side rendering of footer CPT block content with legacy fallback.
- Added a page document setting to override the footer variation and localized editor data for available footer choices.
- Updated/added styles and adjusted footer patterns; removed the old “footer-default” pattern.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
footer.php |
Switches footer rendering to CPT-driven variations with legacy fallback and dynamic footer classes. |
inc/variations.php |
Introduces helpers to pick the active footer slug and render the footer variation content; provides variation choices for UI. |
inc/customizer.php |
Adds “Legacy” vs “Variation” headings and new footer variation selection controls per context. |
inc/editor-settings.php |
Registers new page meta for footer override and localizes editor data including footer choices. |
src/editor/custom-settings.js |
Adds a SelectControl to override footer variation on pages in the editor. |
src/scss/structure/_footer.scss |
Adds styles for footer variation 01 layout behavior. |
src/scss/structure/_header.scss |
Allows header menu items to wrap. |
patterns/footer-01.php |
Tweaks variation 01 pattern markup (colors, site title linking, etc.). |
patterns/footer-02.php |
Tweaks variation 02 pattern markup (colors, link styling, etc.). |
patterns/footer-default.php |
Removes the default footer pattern. |
components/footer/variation-default.php |
Minor whitespace cleanup in the legacy footer template part. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c198d45 to
fcd0e71
Compare
…mizer-updates branch, except we want to support both the legacy/PHP footer and our patterned version
…ter logic so the legacy footer is the fallback/default when variations are not selected or don't exist
…orking, styling tweaks for mobile
1ba4a25 to
e7e836e
Compare
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:
Footer Swapping Logic:
Customizer Updates:
The sanitization/escape chain:
(An explanation of how the values are sanitized for reference.)
Input / Storage
editor-settings.php—register_post_meta()registers_memberlite_footer_overridewith'sanitize_callback' => 'sanitize_key', which runs on every write (REST API orupdate_post_meta). Theme mod values are validated against thememberlite_get_footer_variations()choices list by the Customizer on save.Reading / Passing
variations.php—memberlite_get_current_footer_post_name()reads from post meta or theme mods. Both sources are already sanitized at storage time, so no additional sanitization is needed here. Empty/'0' values fall through to the legacy footer default.Output
footer.php—$footer_post_nameis never echoed raw:sanitize_html_class(), then the full class string is escaped withesc_attr()on the<footer>elementmemberlite_render_footer_variation() → get_page_by_path(), which handles its own query sanitization internallyvariations.php—memberlite_render_footer_variation()outputs viado_blocks(), which produces trusted rendered block HTML; the intentional unescaped output is marked with a phpcs:ignore commentWhy no redundant sanitization mid-flow
The value is a known-clean slug by the time it leaves storage. Each output context applies the appropriate escaping function for that context (attribute vs. CSS class vs. DB lookup) rather than a blanket upstream sanitize call that would be redundant and could mask the actual escape strategy in use.
Other:
How to test the changes in this Pull Request:
memberlite_footerCPT does not yet exist. You should be able to use the block inserter just for that CPT to create footer posts.(Screenshots look a little wonky because my local is on WP 7.0 beta)
New theme options/labeling in Customizer:
New "Override Footer Variation" setting on pages:
Other information:
Changelog entry