Header & Footer Banners Alignment#28
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds alignment options (left, center, right) for header and footer banners in the Banner Container Plugin while updating the admin UI, CSS, and documentation.
- Introduces alignment configuration for banners via new dropdown fields in the admin settings and updates core banner display methods.
- Updates legacy banner fallback and core wrapper generation to incorporate the new alignment parameter.
- Revises plugin versioning and documentation to reflect the enhancements.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| iwz-banner-container-plugin.php | Version bump updates for new alignment feature. |
| includes/class-iwz-banner-container.php | Core logic updated to include alignment parameter for banner output. |
| includes/class-iwz-banner-container-welcome.php | Updated welcome link URL changes. |
| includes/class-iwz-banner-container-settings.php | Added alignment setting registration and UI enhancements; duplicate key removal needed. |
| README.md | Documentation updated to describe the new alignment options. |
| CHANGELOG.md | Changelog updated to capture the new alignment features. |
| $legacy_code = get_option( 'iwz_banner_wp_head_code', '' ); | ||
| if ( ! empty( $legacy_code ) ) { | ||
| $this->output_body_banner_script( $legacy_code ); | ||
| $wrapped_banner = $this->wrap_banner_html( $legacy_code, '', 'wp_head', $alignment ); |
There was a problem hiding this comment.
In the header banner fallback, the legacy banner code is passed directly without sanitization. For consistency with the non-fallback branch where sanitize_banner_html is applied, consider calling sanitize_banner_html on $legacy_code before wrapping.
Suggested change
| $wrapped_banner = $this->wrap_banner_html( $legacy_code, '', 'wp_head', $alignment ); | |
| $sanitized_legacy_code = $this->sanitize_banner_html( $legacy_code ); | |
| $wrapped_banner = $this->wrap_banner_html( $sanitized_legacy_code, '', 'wp_head', $alignment ); |
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.
This pull request introduces banner alignment options for header (
wp_head) and footer (wp_footer) locations in the Banner Container Plugin, along with associated updates to the admin interface, CSS, and documentation. These changes enhance customization by allowing banners to be aligned left, center, or right, while maintaining backward compatibility with existing banners.New Features and Enhancements:
wp_headandwp_footerlocations, configurable via a dropdown in the admin interface. [1] [2]text-alignproperty on wrapper classes (iwz-head-bannerandiwz-footer-banner).Codebase Updates:
Banner Alignment in Core Logic:
wrap_banner_htmlmethod to include alignment as a parameter and apply alignment-specific classes. [1] [2]display_header_banner,display_footer_banner, and their fallback methods to retrieve and apply alignment settings. [1] [2]Admin Interface Enhancements:
Documentation Updates:
CHANGELOG.mdwith details of the new alignment feature.1.9.3iniwz-banner-container-plugin.php.Minor Changes: