Skip to content

Footer customizer updates rb#247

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

Footer customizer updates rb#247
RachelRVasquez wants to merge 6 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.

Other:

  • Updated/tweaked styles via the patterns themselves and in CSS.

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 generate the patterns into our memberlite_footer CPT does not yet exist. You can either duplicate the patterns on the WP-Admin, under Appearance > Design > Patterns > Memberlite - Footers, and then copy the pattern content from your duplicates into new posts that you create in the post type. OR you can just copy the pattern markup from this PR's "Files Changed" tab, to your local with the custom post type.
  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.

…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
@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.

Comment on lines +20 to +24
$footer_post_name = memberlite_get_current_footer_post_name();
$footer_class = 'site-footer';
if ( $footer_post_name && '0' !== $footer_post_name ) {
$footer_class .= ' site-footer-' . sanitize_html_class( $footer_post_name );
} else {
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

$footer_post_name is taken from theme mods/meta and later used for the footer CPT lookup. Sanitize/normalize it once up-front (e.g., sanitize_key()/sanitize_title()) and treat invalid/empty values as “legacy footer”, instead of passing the raw value through.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +23
if ( '' !== $override ) {
return $override;
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The footer override value from post meta is returned/used without sanitization. Since it’s used as a path slug in get_page_by_path(), it should be normalized (e.g., sanitize_key()/sanitize_title()) and ideally constrained to known memberlite_footer slugs (or treated as unset when invalid).

Suggested change
if ( '' !== $override ) {
return $override;
if ( '' !== $override ) {
$override_slug = sanitize_title( $override );
$footer_variations = get_footer_variations();
if ( isset( $footer_variations[ $override_slug ] ) ) {
return $override_slug;
}

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +45
'show_in_rest' => true,
'type' => 'string',
'single' => true,
'default' => '',
'label' => __( 'Select Footer', 'memberlite' ),
'auth_callback' => function() {
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

_memberlite_footer_override is registered as a free-form string with no sanitize_callback. Since it’s intended to store a footer slug, add a sanitization callback (e.g., sanitize_key) to prevent unexpected values from being stored via REST/editor and later used in footer lookup.

Suggested change
'show_in_rest' => true,
'type' => 'string',
'single' => true,
'default' => '',
'label' => __( 'Select Footer', 'memberlite' ),
'auth_callback' => function() {
'show_in_rest' => true,
'type' => 'string',
'single' => true,
'default' => '',
'label' => __( 'Select Footer', 'memberlite' ),
'sanitize_callback' => 'sanitize_key',
'auth_callback' => function() {

Copilot uses AI. Check for mistakes.
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