Skip to content
This repository
Browse code

New filter allows implementors to change the behavior of ACM as it co…

…mes to determining whether to display an ad code or not.

By default, ACM will ignore any ad codes without conditionals. This prevents them from showing up on the frontend as soon as an admin saves the code.

Modify this value to true to have your ad codes appear on the frontend without conditionals

Fixes #16
  • Loading branch information...
commit 229436a5d27e76dabbc05d3893bd084ee57dc7b7 1 parent 0691766
Daniel Bachhuber authored April 05, 2012
2  ad-code-manager.php
@@ -759,7 +759,7 @@ function action_acm_tag( $tag_id ) {
759 759
 
760 760
 			// If the ad code doesn't have any conditionals
761 761
 			// we should add it to the display list
762  
-			if ( empty( $ad_code['conditionals'] ) ) {
  762
+			if ( empty( $ad_code['conditionals'] ) && apply_filters( 'acm_display_ad_codes_without_conditionals', false ) ) {
763 763
 				$display_codes[] = $ad_code;
764 764
 				continue;
765 765
 			}
11  readme.txt
@@ -174,6 +174,17 @@ function my_acm_whiltelisted_script_urls( $whitelisted_urls ) {
174 174
 	return $whitelisted_urls;
175 175
 }`
176 176
 
  177
+= acm_display_ad_codes_without_conditionals =
  178
+
  179
+Change the behavior of Ad Code Manager so that ad codes without conditionals display on the frontend. The default behavior is that each ad code requires a conditional to be included in the presentation logic.
  180
+
  181
+Arguments:
  182
+* bool $behavior Whether or not to display the ad codes that don't have conditionals
  183
+
  184
+Example usage:
  185
+
  186
+`add_filter( 'acm_display_ad_codes_without_conditionals', '__return_true' );`
  187
+
177 188
 Hello WordPress Users Group!
178 189
 
179 190
 == Changelog ==

0 notes on commit 229436a

Please sign in to comment.
Something went wrong with that request. Please try again.