Advanced Ads - Version 1.5.2.1

Version Description

  • fixed inclusion / exclusion of ads for single posts
Download this release

Release Info

Developer webzunft
Plugin Icon 128x128 Advanced Ads
Version 1.5.2.1
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.2.1

advanced-ads.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
- * Version: 1.5.2
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
12
  * Plugin Name: Advanced Ads
13
  * Plugin URI: https://wpadvancedads.com
14
  * Description: Manage and optimize your ads in WordPress
15
+ * Version: 1.5.2.1
16
  * Author: Thomas Maier
17
  * Author URI: http://webgilde.com
18
  * Text Domain: advanced-ads
classes/ad.php CHANGED
@@ -290,7 +290,7 @@ class Advads_Ad {
290
  // check for post ids
291
  case 'postids' :
292
  if ( $wp_the_query->is_singular() && empty($_cond_value['all']) ){
293
- // included posts
294
  if ( ! empty($_cond_value['include']) ){
295
  if ( is_string( $_cond_value['include'] ) ){
296
  $post_ids = explode( ',', $_cond_value['include'] );
@@ -302,7 +302,14 @@ class Advads_Ad {
302
  && ! in_array( $post->ID, $post_ids ) ) {
303
  return false; }
304
  }
305
- // excluded posts
 
 
 
 
 
 
 
306
  if ( ! empty($_cond_value['exclude']) ){
307
  if ( is_string( $_cond_value['exclude'] ) ){
308
  $post_ids = explode( ',', $_cond_value['exclude'] );
@@ -313,6 +320,13 @@ class Advads_Ad {
313
  return false;
314
  }
315
  }
 
 
 
 
 
 
 
316
  }
317
  break;
318
  // check for category ids
290
  // check for post ids
291
  case 'postids' :
292
  if ( $wp_the_query->is_singular() && empty($_cond_value['all']) ){
293
+ // this check is deprecated: included posts
294
  if ( ! empty($_cond_value['include']) ){
295
  if ( is_string( $_cond_value['include'] ) ){
296
  $post_ids = explode( ',', $_cond_value['include'] );
302
  && ! in_array( $post->ID, $post_ids ) ) {
303
  return false; }
304
  }
305
+ // included posts
306
+ if ( ! empty($_cond_value['method']) && 'include' == $_cond_value['method'] ){
307
+ $post_ids = $_cond_value['ids'];
308
+ if ( is_array( $post_ids ) && isset($post->ID) && ! in_array( $post->ID, $post_ids ) ){
309
+ return false;
310
+ }
311
+ }
312
+ // this check is deprecated: excluded posts
313
  if ( ! empty($_cond_value['exclude']) ){
314
  if ( is_string( $_cond_value['exclude'] ) ){
315
  $post_ids = explode( ',', $_cond_value['exclude'] );
320
  return false;
321
  }
322
  }
323
+ // excluded posts
324
+ if ( ! empty($_cond_value['method']) && 'exclude' == $_cond_value['method'] ){
325
+ $post_ids = $_cond_value['ids'];
326
+ if ( is_array( $post_ids ) && isset($post->ID) && in_array( $post->ID, $post_ids ) ){
327
+ return false;
328
+ }
329
+ }
330
  }
331
  break;
332
  // check for category ids
public/class-advanced-ads.php CHANGED
@@ -25,7 +25,7 @@ class Advanced_Ads {
25
  * @var string
26
  */
27
 
28
- const VERSION = '1.5.2';
29
 
30
  /**
31
  * post type slug
25
  * @var string
26
  */
27
 
28
+ const VERSION = '1.5.2.1';
29
 
30
  /**
31
  * post type slug
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id
4
  Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
5
  Requires at least: WP 3.5, PHP 5.3
6
  Tested up to: 4.2
7
- Stable tag: 1.5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -174,6 +174,10 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
174
 
175
  == Changelog ==
176
 
 
 
 
 
177
  = 1.5.2 =
178
 
179
  * fixed empty bots not excluded if option is activated
4
  Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
5
  Requires at least: WP 3.5, PHP 5.3
6
  Tested up to: 4.2
7
+ Stable tag: 1.5.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
174
 
175
  == Changelog ==
176
 
177
+ = 1.5.2.1 =
178
+
179
+ * fixed inclusion / exclusion of ads for single posts
180
+
181
  = 1.5.2 =
182
 
183
  * fixed empty bots not excluded if option is activated