Skip to content

Custom Banner Class#24

Merged
jasperf merged 1 commit into
mainfrom
custom-banner-class
May 28, 2025
Merged

Custom Banner Class#24
jasperf merged 1 commit into
mainfrom
custom-banner-class

Conversation

@jasperf

@jasperf jasperf commented May 28, 2025

Copy link
Copy Markdown
Contributor

This pull request introduces a new feature to wrap banners in customizable div elements with CSS classes, along with enhancements to the admin interface, data structure, and code quality. The changes ensure backward compatibility and include updates to both PHP and JavaScript for seamless integration.

New Feature: Div Wrapper for Banners

  • Added a wrap_banner_html() utility method to wrap banner HTML in a div with a custom CSS class, ensuring consistent implementation across all banner types. (includes/class-iwz-banner-container.php)
  • Updated banner rendering methods to use the new wrap_banner_html() function, allowing banners to include the optional wrapper class. (includes/class-iwz-banner-container.php) [1] [2] [3] [4] [5] [6] [7] [8] [9]

Admin Interface Enhancements

  • Added a "Wrapper CSS Class" input field for both content and location banners in the admin settings interface. (includes/class-iwz-banner-container-settings.php) [1] [2]
  • Updated the JavaScript function updateBannerCount() to dynamically include the "Wrapper CSS Class" field for new banners. (includes/class-iwz-banner-container-settings.php) [1] [2]

Data Structure Updates

  • Extended the banner data structure to include a wrapper_class field, with proper sanitization to ensure security. (includes/class-iwz-banner-container-settings.php)

Documentation and Metadata

  • Updated the plugin version to 1.8.2 and documented the new feature in the CHANGELOG.md file. (iwz-banner-container-plugin.php, CHANGELOG.md) [1] [2] [3]

@jasperf jasperf merged commit 763a7a6 into main May 28, 2025
5 checks passed
@jasperf jasperf deleted the custom-banner-class branch May 28, 2025 05:31
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.

1 participant