Skip to content

Individual sticky footer banner#30

Merged
jasperf merged 3 commits into
mainfrom
individual-sticky-footer-banner
Jun 4, 2025
Merged

Individual sticky footer banner#30
jasperf merged 3 commits into
mainfrom
individual-sticky-footer-banner

Conversation

@jasperf

@jasperf jasperf commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces a breaking change to the sticky footer banner functionality in the iwz-banner-container-plugin, transitioning from a global sticky setting to individual banner-level control. It also includes enhancements to the user interface, backward compatibility adjustments, and updates to the plugin's version.

Breaking Changes:

  • Removed the global sticky footer banner setting and replaced it with individual sticky settings for each footer banner, allowing more granular control. (CHANGELOG.md - [1] class-iwz-banner-container-settings.php - [2] [3]

Enhancements:

  • Added a new "sticky" checkbox for each footer banner in the admin interface, enabling users to toggle the sticky behavior for individual banners. (class-iwz-banner-container-settings.php - [1] [2]
  • Updated the sanitize_location_banners function to handle the new individual sticky setting. (class-iwz-banner-container-settings.php - includes/class-iwz-banner-container-settings.phpR344-R348)
  • Improved debug logging to indicate whether individual sticky settings are enabled or disabled for each banner. (class-iwz-banner-container.php - includes/class-iwz-banner-container.phpR325-R332)

Technical Adjustments:

  • Refactored the display_footer_banner function to remove dependencies on the global sticky setting and use only the individual banner sticky settings. (class-iwz-banner-container.php - [1] [2]
  • Updated plugin version to 1.9.6 and documented the changes in the CHANGELOG.md file. (iwz-banner-container-plugin.php - [1] [2] CHANGELOG.md - [3]

@jasperf jasperf requested a review from Copilot June 4, 2025 03:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the sticky footer banner functionality by replacing a global sticky setting with individual banner-level sticky settings, while also updating the version and related UI elements for better control and backward compatibility.

  • Breaking change: Removed global sticky setting and updated debug logs to reflect individual banner sticky behavior
  • Enhancement: Added sticky setting controls for individual footer banners in both PHP settings and JavaScript UI updates
  • Technical adjustment: Updated plugin version constants and documentation in CHANGELOG.md

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
iwz-banner-container-plugin.php Updated version constants to reflect the new version
includes/class-iwz-banner-container.php Removed global sticky setting and refactored debug logging for sticky
includes/class-iwz-banner-container-settings.php Removed global sticky setting registration and added individual banner sticky controls
CHANGELOG.md Updated changelog information to document breaking changes and enhancements

$alignment = $banner['alignment'] ?? get_option( 'iwz_banner_wp_footer_alignment', 'left' );
$alignment = $banner['alignment'] ?? get_option( 'iwz_banner_wp_footer_alignment', 'left' );
// Use ONLY individual banner sticky setting.
$sticky = isset( $banner['sticky'] ) ? $banner['sticky'] : false;

Copilot AI Jun 4, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] Consider using the null coalescing operator for improved readability, e.g., '$sticky = $banner['sticky'] ?? false;'.

Suggested change
$sticky = isset( $banner['sticky'] ) ? $banner['sticky'] : false;
$sticky = $banner['sticky'] ?? false;

Copilot uses AI. Check for mistakes.
@jasperf jasperf merged commit ab77e61 into main Jun 4, 2025
5 checks passed
@jasperf jasperf deleted the individual-sticky-footer-banner branch June 4, 2025 03:22
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