Skip to content

Footer customizer updates rb#247

Draft
RachelRVasquez wants to merge 10 commits intostrangerstudios:memberlite-footer-variationsfrom
RachelRVasquez:footer-customizer-updates-rb
Draft

Footer customizer updates rb#247
RachelRVasquez wants to merge 10 commits intostrangerstudios:memberlite-footer-variationsfrom
RachelRVasquez:footer-customizer-updates-rb

Conversation

@RachelRVasquez
Copy link
Copy Markdown
Collaborator

@RachelRVasquez RachelRVasquez commented Mar 27, 2026

All Submissions:

Changes proposed in this Pull Request:

Footer Swapping Logic:

  • Existing (legacy) PHP template footer now acts as a default/fallback when the theme variation versions are not being used.
  • Added new document/editor setting on pages (for now) to override footer variation there. (post meta)
  • Deleted the “footer-default.php” pattern. It’s confusing now that we have the legacy version and they look the same. Decided we likely won’t need that.

Customizer Updates:

  • We’ve kept the copyright and widget column theme mods for the legacy footer.
  • We’ve added theme mod settings to select footer variation (patterns) for the Default, Blog & Archives, Single Post and Page view.
  • We’ve added two headings and re-labeled the settings in the Footer panel to differentiate between the “Legacy” and “Variation” versions of the footer.

The sanitization/escape chain:

(An explanation of how the values are sanitized for reference.)

Input / Storage

  • editor-settings.phpregister_post_meta() registers _memberlite_footer_override with 'sanitize_callback' => 'sanitize_key', which runs on every write (REST API or update_post_meta). Theme mod values are validated against the memberlite_get_footer_variations() choices list by the Customizer on save.

Reading / Passing

  • variations.phpmemberlite_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_name is never echoed raw:
    • Used as a CSS class suffix via sanitize_html_class(), then the full class string is escaped with esc_attr() on the <footer> element
    • Passed to memberlite_render_footer_variation() → get_page_by_path(), which handles its own query sanitization internally
  • variations.phpmemberlite_render_footer_variation() outputs via do_blocks(), which produces trusted rendered block HTML; the intentional unescaped output is marked with a phpcs:ignore comment

Why 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:

  • Updated/tweaked styles via the patterns themselves and in CSS.
  • Added a new pattern for the footer, variation 3.
    • ⚠️ It requires WordPress 7.0 to display properly because it's using the icon block.
image

How to test the changes in this Pull Request:

  1. Confirm that the Memberlite 7.0 PHP version of the footer is still intact when switching to this branch.
  2. The code to automatically generate the patterns into our memberlite_footer CPT does not yet exist. You should be able to use the block inserter just for that CPT to create footer posts.
  3. On the WP-Admin, navigate to Appearance > Customizer > Footer. Is the new labeling clear? Are the footers from the custom post type showing as options?
  4. Test setting different footers across the site.
  5. Also go to a page, and test that the override works.

(Screenshots look a little wonky because my local is on WP 7.0 beta)

New theme options/labeling in Customizer:

image

New "Override Footer Variation" setting on pages:

image

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

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. Also added a new footer variation pattern.

@RachelRVasquez RachelRVasquez changed the base branch from dev to memberlite-footer-variations March 27, 2026 17:48
@RachelRVasquez RachelRVasquez requested a review from Copilot March 27, 2026 18:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@RachelRVasquez RachelRVasquez force-pushed the footer-customizer-updates-rb branch from c198d45 to fcd0e71 Compare April 3, 2026 15:56
@RachelRVasquez RachelRVasquez force-pushed the footer-customizer-updates-rb branch from 1ba4a25 to e7e836e Compare April 3, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants