Add wrapper div with CSS classes for improved ad styling#188
Merged
Add wrapper div with CSS classes for improved ad styling#188
Conversation
This addresses a long-standing request from 2013 for better styling control of ad output. Previously, themes needed to target ads by numeric IDs that could change, making consistent styling difficult.
The implementation wraps all ad output in a div with descriptive CSS classes: a generic 'acm-wrapper' class for broad styling rules, and a tag-specific 'acm-tag-{tag_id}' class for targeted control. This enables straightforward centering and other layout adjustments without depending on fragile numeric IDs.
A new 'acm_wrapper_classes' filter allows developers to customise the classes or disable the wrapper entirely by returning an empty array, ensuring backwards compatibility for sites that need to opt out.
Fixes #71
GaryJones
added a commit
that referenced
this pull request
Dec 21, 2025
Add comprehensive PHPDoc documentation for all 24 filters and 2 actions in the Ad Code Manager plugin, improving discoverability and developer experience. Documented filters include: - Configuration: acm_register_provider_slug, acm_provider_slug, acm_whitelisted_script_urls, acm_whitelisted_conditionals, acm_logical_operator, acm_manage_ads_cap, acm_ad_tag_ids, acm_ad_code_args - Rendering: acm_output_html, acm_output_tokens, acm_output_html_after_tokens_processed, acm_disable_ad_rendering, acm_wrapper_classes (already documented in #188) - Matching: acm_display_ad_codes_without_conditionals, acm_conditional_args, acm_reset_postdata_before_match, acm_matching_ad_code_cache_expiration - Admin: acm_list_table_columns, acm_list_table_per_page, acm_validate_ad_code, acm_allowed_get_posts_args, acm_ad_code_count - Other: acm_default_url, acm_should_do_robotstxt, acm_robotstxt_disallow Documented actions: - acm_tag: Displays an ad tag on the frontend - acm_options_form: Fires in the options form Fixes #157 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged
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.
Summary
acm-wrapper(generic) andacm-tag-{tag_id}(specific)acm_wrapper_classesfilter allows customisation or disabling the wrapperThis addresses a long-standing request (from 2013) for better CSS targeting of ads without relying on fragile numeric IDs.
Test plan
class="acm-wrapper acm-tag-{tag_id}"acm_wrapper_classesfilter can add custom classescomposer test:integrationFixes #71
🤖 Generated with Claude Code