Version Description
- hide contrainer class, id and ad debug mode in Wizard
- fixed term query showing on every page impression
- fixed capabilities issue with Theia post slider
- fixed unnecessary admin notifications queries
- fixed ad title disappear when type was selected
- fixed ad group parameter layout
- fixed init hook to allow adding custom taxonomies
- ad meta boxes are now forced to be visible
- added link to advertisement label manual
Download this release
Release Info
Developer | webzunft |
Plugin | Advanced Ads |
Version | 1.7.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.4.1 to 1.7.4.2
- admin/assets/js/wizard.js +8 -4
- admin/class-advanced-ads-admin.php +45 -1
- admin/includes/class-notices.php +41 -25
- admin/includes/notices.php +1 -1
- admin/views/ad-output-metabox.php +9 -9
- advanced-ads.php +1 -1
- classes/ad_placements.php +1 -1
- classes/ad_type_group.php +2 -2
- classes/display-conditions.php +3 -5
- public/class-advanced-ads.php +3 -0
- readme.txt +13 -1
admin/assets/js/wizard.js
CHANGED
@@ -27,10 +27,6 @@ var advads_wizard = {
|
|
27 |
jQuery( '.advads-stop-wizard' ).click( function(){
|
28 |
self.close();
|
29 |
});
|
30 |
-
// jump to next box when ad type is selected
|
31 |
-
jQuery('#advanced-ad-type input').change(function(){
|
32 |
-
self.next();
|
33 |
-
});
|
34 |
},
|
35 |
show_current_box: function(){
|
36 |
jQuery( this.current_box ).removeClass('advads-hide');
|
@@ -53,9 +49,15 @@ var advads_wizard = {
|
|
53 |
// initially hide some elemente
|
54 |
jQuery( '#advads-ad-description').addClass('advads-hide'); // ad description
|
55 |
jQuery( '#advads-ad-info').addClass('advads-hide'); // shortcode and php function info
|
|
|
|
|
56 |
// remove close-class from ad type box
|
57 |
jQuery( '#ad-main-box' ).removeClass('closed');
|
58 |
this.save_hide_wizard( false );
|
|
|
|
|
|
|
|
|
59 |
},
|
60 |
close: function(){ // close the wizard by showing all elements again
|
61 |
jQuery('*').removeClass('advads-hide');
|
@@ -64,6 +66,8 @@ var advads_wizard = {
|
|
64 |
jQuery( '#post-body').addClass( 'columns-2' ).removeClass( 'columns-1' );
|
65 |
}
|
66 |
jQuery('#advads-wizard-welcome').remove();// close wizard welcome message
|
|
|
|
|
67 |
this.save_hide_wizard( true );
|
68 |
},
|
69 |
update_nav: function(){ // update navigation, display only valid buttons
|
27 |
jQuery( '.advads-stop-wizard' ).click( function(){
|
28 |
self.close();
|
29 |
});
|
|
|
|
|
|
|
|
|
30 |
},
|
31 |
show_current_box: function(){
|
32 |
jQuery( this.current_box ).removeClass('advads-hide');
|
49 |
// initially hide some elemente
|
50 |
jQuery( '#advads-ad-description').addClass('advads-hide'); // ad description
|
51 |
jQuery( '#advads-ad-info').addClass('advads-hide'); // shortcode and php function info
|
52 |
+
// hide all elements with 'advads-hide-for-wizard' class
|
53 |
+
jQuery( '.advads-hide-in-wizard').hide();
|
54 |
// remove close-class from ad type box
|
55 |
jQuery( '#ad-main-box' ).removeClass('closed');
|
56 |
this.save_hide_wizard( false );
|
57 |
+
// jump to next box when ad type is selected
|
58 |
+
jQuery('#advanced-ad-type input').change(function(){
|
59 |
+
self.next();
|
60 |
+
});
|
61 |
},
|
62 |
close: function(){ // close the wizard by showing all elements again
|
63 |
jQuery('*').removeClass('advads-hide');
|
66 |
jQuery( '#post-body').addClass( 'columns-2' ).removeClass( 'columns-1' );
|
67 |
}
|
68 |
jQuery('#advads-wizard-welcome').remove();// close wizard welcome message
|
69 |
+
// show all elements with 'advads-hide-for-wizard' class
|
70 |
+
jQuery( '.advads-hide-in-wizard').show();
|
71 |
this.save_hide_wizard( true );
|
72 |
},
|
73 |
update_nav: function(){ // update navigation, display only valid buttons
|
admin/class-advanced-ads-admin.php
CHANGED
@@ -66,6 +66,14 @@ class Advanced_Ads_Admin {
|
|
66 |
* @var string
|
67 |
*/
|
68 |
protected $post_type = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
/**
|
71 |
* Initialize the plugin by loading admin scripts & styles and adding a
|
@@ -665,6 +673,37 @@ class Advanced_Ads_Admin {
|
|
665 |
add_meta_box(
|
666 |
'ad-visitor-box', __( 'Visitor Conditions', 'advanced-ads' ), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
|
667 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
}
|
669 |
|
670 |
/**
|
@@ -1344,7 +1383,7 @@ class Advanced_Ads_Admin {
|
|
1344 |
<input type="checkbox" <?php checked( $enabled, true ); ?> value="1" onclick="advads_toggle_box( this, '#advads-custom-label' );" name="<?php echo ADVADS_SLUG . '[custom-label][enabled]'; ?>" />
|
1345 |
<input <?php if ( ! $enabled ) echo 'style="display:none;"' ?> id="advads-custom-label" type="text" value="<?php echo $label; ?>" name="<?php echo ADVADS_SLUG . '[custom-label][text]'; ?>" />
|
1346 |
</fieldset>
|
1347 |
-
|
1348 |
|
1349 |
<?php
|
1350 |
}
|
@@ -1859,6 +1898,10 @@ class Advanced_Ads_Admin {
|
|
1859 |
} else {
|
1860 |
// save license value time
|
1861 |
update_option($options_slug . '-license-expires', $license_data->expires, false);
|
|
|
|
|
|
|
|
|
1862 |
// save license key
|
1863 |
$licenses = $this->get_licenses();
|
1864 |
$licenses[ $addon ] = $license_key;
|
@@ -1942,6 +1985,7 @@ class Advanced_Ads_Admin {
|
|
1942 |
if( 'deactivated' === $license_data->license ) {
|
1943 |
delete_option( $options_slug . '-license-status' );
|
1944 |
delete_option( $options_slug . '-license-expires' );
|
|
|
1945 |
} elseif( 'failed' === $license_data->license ) {
|
1946 |
update_option($options_slug . '-license-expires', $license_data->expires, false);
|
1947 |
update_option($options_slug . '-license-status', $license_data->license, false);
|
66 |
* @var string
|
67 |
*/
|
68 |
protected $post_type = '';
|
69 |
+
|
70 |
+
/**
|
71 |
+
* meta box ids
|
72 |
+
*
|
73 |
+
* @since 1.7.4.2
|
74 |
+
* @var array
|
75 |
+
*/
|
76 |
+
protected $meta_box_ids = array();
|
77 |
|
78 |
/**
|
79 |
* Initialize the plugin by loading admin scripts & styles and adding a
|
673 |
add_meta_box(
|
674 |
'ad-visitor-box', __( 'Visitor Conditions', 'advanced-ads' ), array($this, 'markup_meta_boxes'), Advanced_Ads::POST_TYPE_SLUG, 'normal', 'high'
|
675 |
);
|
676 |
+
|
677 |
+
// register meta box ids
|
678 |
+
$this->meta_box_ids = array(
|
679 |
+
'ad-main-box',
|
680 |
+
'ad-parameters-box',
|
681 |
+
'ad-output-box',
|
682 |
+
'ad-display-box',
|
683 |
+
'ad-visitor-box',
|
684 |
+
'advanced_ads_groupsdiv' // automatically added by ad groups taxonomy
|
685 |
+
);
|
686 |
+
|
687 |
+
// force AA meta boxes to never be completely hidden by screen options
|
688 |
+
add_filter( 'hidden_meta_boxes', array( $this, 'unhide_meta_boxes' ), 10, 2 );
|
689 |
+
|
690 |
+
}
|
691 |
+
|
692 |
+
/**
|
693 |
+
* force all AA related meta boxes to stay visible
|
694 |
+
*
|
695 |
+
* @since 1.7.4.2
|
696 |
+
* @param
|
697 |
+
*/
|
698 |
+
public function unhide_meta_boxes( $hidden, $screen ){
|
699 |
+
|
700 |
+
// only check on Advanced Ads edit screen
|
701 |
+
if ( ! isset( $screen->id ) || $screen->id !== 'advanced_ads' || !is_array( $this->meta_box_ids ) ) {
|
702 |
+
return $hidden;
|
703 |
+
}
|
704 |
+
|
705 |
+
// return only hidden elements which are not among the Advanced Ads meta box ids
|
706 |
+
return array_diff( $hidden, $this->meta_box_ids );
|
707 |
}
|
708 |
|
709 |
/**
|
1383 |
<input type="checkbox" <?php checked( $enabled, true ); ?> value="1" onclick="advads_toggle_box( this, '#advads-custom-label' );" name="<?php echo ADVADS_SLUG . '[custom-label][enabled]'; ?>" />
|
1384 |
<input <?php if ( ! $enabled ) echo 'style="display:none;"' ?> id="advads-custom-label" type="text" value="<?php echo $label; ?>" name="<?php echo ADVADS_SLUG . '[custom-label][text]'; ?>" />
|
1385 |
</fieldset>
|
1386 |
+
<p class="description"><?php _e( 'Displayed above ads.', 'advanced-ads' ); ?> <a target="_blank" href="<?php echo ADVADS_URL . 'manual/advertisement-label/#utm_source=advanced-ads&utm_medium=link&utm_campaign=settings-advertisement-label'?>"><?php _e( 'Manual', 'advanced-ads' ); ?></a></p>
|
1387 |
|
1388 |
<?php
|
1389 |
}
|
1898 |
} else {
|
1899 |
// save license value time
|
1900 |
update_option($options_slug . '-license-expires', $license_data->expires, false);
|
1901 |
+
// reset license_expires admin notification
|
1902 |
+
Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expires' );
|
1903 |
+
Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expired' );
|
1904 |
+
Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_invalid' );
|
1905 |
// save license key
|
1906 |
$licenses = $this->get_licenses();
|
1907 |
$licenses[ $addon ] = $license_key;
|
1985 |
if( 'deactivated' === $license_data->license ) {
|
1986 |
delete_option( $options_slug . '-license-status' );
|
1987 |
delete_option( $options_slug . '-license-expires' );
|
1988 |
+
Advanced_Ads_Admin_Notices::get_instance()->remove_from_queue( 'license_expires' );
|
1989 |
} elseif( 'failed' === $license_data->license ) {
|
1990 |
update_option($options_slug . '-license-expires', $license_data->expires, false);
|
1991 |
update_option($options_slug . '-license-status', $license_data->license, false);
|
admin/includes/class-notices.php
CHANGED
@@ -191,30 +191,38 @@ class Advanced_Ads_Admin_Notices {
|
|
191 |
*/
|
192 |
public function register_license_notices(){
|
193 |
|
194 |
-
if( Advanced_Ads_Admin::screen_belongs_to_advanced_ads() ){
|
|
|
|
|
195 |
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
|
|
|
|
|
|
205 |
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
if ( Advanced_Ads_Checks::licenses_expired() && ! in_array( 'license_expired', $queue )) {
|
214 |
-
$this->notices[] = 'license_expired';
|
215 |
-
} else {
|
216 |
-
$this->remove_from_queue( 'license_expired' );
|
217 |
-
}
|
218 |
}
|
219 |
}
|
220 |
|
@@ -286,7 +294,7 @@ class Advanced_Ads_Admin_Notices {
|
|
286 |
}
|
287 |
|
288 |
// get queue from options
|
289 |
-
$options = $this->options();
|
290 |
if ( ! isset($options['queue']) ) {
|
291 |
return;
|
292 |
}
|
@@ -298,12 +306,20 @@ class Advanced_Ads_Admin_Notices {
|
|
298 |
unset($queue[$key]);
|
299 |
// close message with timestamp
|
300 |
}
|
301 |
-
|
302 |
-
|
|
|
|
|
|
|
303 |
// update db
|
304 |
$options['queue'] = $queue;
|
305 |
$options['closed'] = $closed;
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
307 |
}
|
308 |
|
309 |
/**
|
191 |
*/
|
192 |
public function register_license_notices(){
|
193 |
|
194 |
+
if( ! Advanced_Ads_Admin::screen_belongs_to_advanced_ads() ){
|
195 |
+
return;
|
196 |
+
}
|
197 |
|
198 |
+
$options = $this->options();
|
199 |
+
$queue = isset($options['queue']) ? $options['queue'] : array();
|
200 |
+
// check license keys
|
201 |
+
|
202 |
+
if ( Advanced_Ads_Checks::licenses_invalid() ){
|
203 |
+
if( ! in_array( 'license_invalid', $queue )) {
|
204 |
+
$this->notices[] = 'license_invalid';
|
205 |
+
}
|
206 |
+
} else {
|
207 |
+
$this->remove_from_queue( 'license_invalid' );
|
208 |
+
}
|
209 |
|
210 |
+
// check expiring licenses
|
211 |
+
if ( Advanced_Ads_Checks::licenses_expire() ){
|
212 |
+
if( ! in_array( 'license_expires', $queue )) {
|
213 |
+
$this->notices[] = 'license_expires';
|
214 |
+
}
|
215 |
+
} else {
|
216 |
+
$this->remove_from_queue( 'license_expires' );
|
217 |
+
}
|
218 |
|
219 |
+
// check expired licenses
|
220 |
+
if ( Advanced_Ads_Checks::licenses_expired() ){
|
221 |
+
if( ! in_array( 'license_expired', $queue )) {
|
222 |
+
$this->notices[] = 'license_expired';
|
223 |
+
}
|
224 |
+
} else {
|
225 |
+
$this->remove_from_queue( 'license_expired' );
|
|
|
|
|
|
|
|
|
|
|
226 |
}
|
227 |
}
|
228 |
|
294 |
}
|
295 |
|
296 |
// get queue from options
|
297 |
+
$options_before = $options = $this->options();
|
298 |
if ( ! isset($options['queue']) ) {
|
299 |
return;
|
300 |
}
|
306 |
unset($queue[$key]);
|
307 |
// close message with timestamp
|
308 |
}
|
309 |
+
// don’t close again twice
|
310 |
+
if( ! isset( $closed[$notice] )){
|
311 |
+
$closed[$notice] = time();
|
312 |
+
}
|
313 |
+
|
314 |
// update db
|
315 |
$options['queue'] = $queue;
|
316 |
$options['closed'] = $closed;
|
317 |
+
|
318 |
+
|
319 |
+
// only update if changed
|
320 |
+
if( $options_before !== $options ){
|
321 |
+
$this->update_options( $options );
|
322 |
+
}
|
323 |
}
|
324 |
|
325 |
/**
|
admin/includes/notices.php
CHANGED
@@ -64,7 +64,7 @@ $advanced_ads_admin_notices = apply_filters( 'advanced-ads-notices', array(
|
|
64 |
// license expires
|
65 |
'license_expires' => array(
|
66 |
'type' => 'plugin_error',
|
67 |
-
'text' => sprintf( __( 'One or more licenses for your <strong>Advanced Ads add-ons are expiring soon</strong>. Don’t risk to lose support and updates and renew your license before it expires with a significant discount on <a href="%s" target="_blank">the add-on page</a>.', 'advanced-ads' ),
|
68 |
'global' => true
|
69 |
),
|
70 |
// license expired
|
64 |
// license expires
|
65 |
'license_expires' => array(
|
66 |
'type' => 'plugin_error',
|
67 |
+
'text' => sprintf( __( 'One or more licenses for your <strong>Advanced Ads add-ons are expiring soon</strong>. Don’t risk to lose support and updates and renew your license before it expires with a significant discount on <a href="%s" target="_blank">the add-on page</a>.', 'advanced-ads' ), admin_url( 'admin.php?page=advanced-ads-settings#top#licenses' ) ),
|
68 |
'global' => true
|
69 |
),
|
70 |
// license expired
|
admin/views/ad-output-metabox.php
CHANGED
@@ -31,21 +31,21 @@
|
|
31 |
if ( isset($options['margin']['left']) ) { echo $options['margin']['left']; } ?>" name="advanced_ad[output][margin][left]"/>px</label>
|
32 |
<p class="description"><?php _e( 'tip: use this to add a margin around the ad', 'advanced-ads' ); ?></p>
|
33 |
</div>
|
34 |
-
<hr/>
|
35 |
-
<label class='label' for="advads-output-wrapper-id"><?php _e( 'container ID', 'advanced-ads' ); ?></label>
|
36 |
-
<div>
|
37 |
<input type="text" id="advads-output-wrapper-id" name="advanced_ad[output][wrapper-id]" value="<?php if ( isset($options['wrapper-id']) ) { echo $options['wrapper-id']; } ?>"/>
|
38 |
<p class="description"><?php _e( 'Specify the id of the ad container. Leave blank for random or no id.', 'advanced-ads' ); ?></p>
|
39 |
</div>
|
40 |
-
<hr/>
|
41 |
-
<label class='label' for="advads-output-wrapper-class"><?php _e( 'container classes', 'advanced-ads' ); ?></label>
|
42 |
-
<div>
|
43 |
<input type="text" id="advads-output-wrapper-class" name="advanced_ad[output][wrapper-class]" value="<?php if ( isset($options['wrapper-class']) ) { echo $options['wrapper-class']; } ?>"/>
|
44 |
<p class="description"><?php _e( 'Specify one or more classes for the container. Separate multiple classes with a space', 'advanced-ads.' ); ?></p>
|
45 |
</div>
|
46 |
-
<hr/>
|
47 |
-
<label class="label"><?php _e( 'Enable debug mode', 'advanced-ads' ); ?></label>
|
48 |
-
<div>
|
49 |
<input type="checkbox" name="advanced_ad[output][debugmode]" value="1"<?php if ( isset($options['debugmode']) ) { checked( $options['debugmode'], 1 ); } ?>/>
|
50 |
<a href="<?php echo ADVADS_URL; ?>manual/ad-debug-mode/#utm_source=advanced-ads&utm_medium=link&utm_campaign=ad-debug-mode" target="_blank"><?php _e( 'Manual', 'advanced-ads' ); ?></a>
|
51 |
</div>
|
31 |
if ( isset($options['margin']['left']) ) { echo $options['margin']['left']; } ?>" name="advanced_ad[output][margin][left]"/>px</label>
|
32 |
<p class="description"><?php _e( 'tip: use this to add a margin around the ad', 'advanced-ads' ); ?></p>
|
33 |
</div>
|
34 |
+
<hr class="advads-hide-in-wizard"/>
|
35 |
+
<label class='label advads-hide-in-wizard' for="advads-output-wrapper-id"><?php _e( 'container ID', 'advanced-ads' ); ?></label>
|
36 |
+
<div class="advads-hide-in-wizard">
|
37 |
<input type="text" id="advads-output-wrapper-id" name="advanced_ad[output][wrapper-id]" value="<?php if ( isset($options['wrapper-id']) ) { echo $options['wrapper-id']; } ?>"/>
|
38 |
<p class="description"><?php _e( 'Specify the id of the ad container. Leave blank for random or no id.', 'advanced-ads' ); ?></p>
|
39 |
</div>
|
40 |
+
<hr class="advads-hide-in-wizard"/>
|
41 |
+
<label class='label advads-hide-in-wizard' for="advads-output-wrapper-class"><?php _e( 'container classes', 'advanced-ads' ); ?></label>
|
42 |
+
<div class="advads-hide-in-wizard">
|
43 |
<input type="text" id="advads-output-wrapper-class" name="advanced_ad[output][wrapper-class]" value="<?php if ( isset($options['wrapper-class']) ) { echo $options['wrapper-class']; } ?>"/>
|
44 |
<p class="description"><?php _e( 'Specify one or more classes for the container. Separate multiple classes with a space', 'advanced-ads.' ); ?></p>
|
45 |
</div>
|
46 |
+
<hr class="advads-hide-in-wizard"/>
|
47 |
+
<label class="label advads-hide-in-wizard"><?php _e( 'Enable debug mode', 'advanced-ads' ); ?></label>
|
48 |
+
<div class="advads-hide-in-wizard">
|
49 |
<input type="checkbox" name="advanced_ad[output][debugmode]" value="1"<?php if ( isset($options['debugmode']) ) { checked( $options['debugmode'], 1 ); } ?>/>
|
50 |
<a href="<?php echo ADVADS_URL; ?>manual/ad-debug-mode/#utm_source=advanced-ads&utm_medium=link&utm_campaign=ad-debug-mode" target="_blank"><?php _e( 'Manual', 'advanced-ads' ); ?></a>
|
51 |
</div>
|
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.7.4.
|
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.7.4.2
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: http://webgilde.com
|
18 |
* Text Domain: advanced-ads
|
classes/ad_placements.php
CHANGED
@@ -429,7 +429,7 @@ class Advanced_Ads_Placements {
|
|
429 |
$adDom->loadHtml('<!DOCTYPE html><html><meta http-equiv="Content-Type" content="text/html; charset=' . $wpCharset . '" /><body>' . $adContent);
|
430 |
// log errors
|
431 |
if( libxml_get_last_error() instanceof LibXMLError ){
|
432 |
-
Advanced_Ads::log( 'content injection error: ' . print_r( libxml_get_last_error(), true ) );
|
433 |
}
|
434 |
$adNode = $adDom->lastChild->lastChild; // >html>body
|
435 |
libxml_use_internal_errors(false);
|
429 |
$adDom->loadHtml('<!DOCTYPE html><html><meta http-equiv="Content-Type" content="text/html; charset=' . $wpCharset . '" /><body>' . $adContent);
|
430 |
// log errors
|
431 |
if( libxml_get_last_error() instanceof LibXMLError ){
|
432 |
+
Advanced_Ads::log( 'content injection error for placement "' . $placement_id . '": ' . print_r( libxml_get_last_error(), true ) );
|
433 |
}
|
434 |
$adNode = $adDom->lastChild->lastChild; // >html>body
|
435 |
libxml_use_internal_errors(false);
|
classes/ad_type_group.php
CHANGED
@@ -81,13 +81,13 @@ class Advanced_Ads_Ad_Type_Group extends Advanced_Ads_Ad_Type_Abstract{
|
|
81 |
return;
|
82 |
}
|
83 |
|
84 |
-
?><label for="advads-group-id"><?php _e('ad group', 'advanced-ads'); ?></label><select name="advanced_ad[output][group_id]" id="advads-group-id"><?php
|
85 |
|
86 |
foreach ( $groups as $_group ) {
|
87 |
?><option value="<?php echo $_group->term_id; ?>" <?php selected( $_group->term_id, $group_id ); ?>><?php echo $_group->name; ?></option><?php
|
88 |
}
|
89 |
|
90 |
-
?></select
|
91 |
|
92 |
}
|
93 |
|
81 |
return;
|
82 |
}
|
83 |
|
84 |
+
?><label for="advads-group-id" class="label"><?php _e('ad group', 'advanced-ads'); ?></label><div><select name="advanced_ad[output][group_id]" id="advads-group-id"><?php
|
85 |
|
86 |
foreach ( $groups as $_group ) {
|
87 |
?><option value="<?php echo $_group->term_id; ?>" <?php selected( $_group->term_id, $group_id ); ?>><?php echo $_group->name; ?></option><?php
|
88 |
}
|
89 |
|
90 |
+
?></select></div><hr/><?php
|
91 |
|
92 |
}
|
93 |
|
classes/display-conditions.php
CHANGED
@@ -54,8 +54,8 @@ class Advanced_Ads_Display_Conditions {
|
|
54 |
add_filter('advanced-ads-ad-select-args', array($this, 'ad_select_args_callback'));
|
55 |
add_filter('advanced-ads-can-display', array($this, 'can_display'), 10, 2);
|
56 |
|
57 |
-
// register conditions with init hook
|
58 |
-
add_action( 'init', array($this, 'register_conditions'),
|
59 |
}
|
60 |
|
61 |
/**
|
@@ -95,9 +95,7 @@ class Advanced_Ads_Display_Conditions {
|
|
95 |
// register a condition for each taxonomy for posts
|
96 |
$taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true), 'objects', 'or');
|
97 |
foreach ($taxonomies as $_tax) :
|
98 |
-
|
99 |
-
$terms = get_terms($_tax->name, array('hide_empty' => false, 'number' => 1));
|
100 |
-
if (is_wp_error($terms) || !count($terms) || $_tax->name === 'advanced_ads_groups') {
|
101 |
continue;
|
102 |
}
|
103 |
|
54 |
add_filter('advanced-ads-ad-select-args', array($this, 'ad_select_args_callback'));
|
55 |
add_filter('advanced-ads-can-display', array($this, 'can_display'), 10, 2);
|
56 |
|
57 |
+
// register conditions with init hook, register as late as possible so other plugins can use the same hook to add new taxonomies
|
58 |
+
add_action( 'init', array($this, 'register_conditions'), 100 );
|
59 |
}
|
60 |
|
61 |
/**
|
95 |
// register a condition for each taxonomy for posts
|
96 |
$taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true), 'objects', 'or');
|
97 |
foreach ($taxonomies as $_tax) :
|
98 |
+
if ( in_array( $_tax->name, array( 'advanced_ads_groups', 'post_format' ) ) ) {
|
|
|
|
|
99 |
continue;
|
100 |
}
|
101 |
|
public/class-advanced-ads.php
CHANGED
@@ -613,6 +613,9 @@ class Advanced_Ads {
|
|
613 |
'edit_post' => 'advanced_ads_edit_ads',
|
614 |
'read_post' => 'advanced_ads_edit_ads',
|
615 |
'delete_post' => 'advanced_ads_edit_ads',
|
|
|
|
|
|
|
616 |
// Primitive capabilities used outside of map_meta_cap()
|
617 |
'edit_posts' => 'advanced_ads_edit_ads',
|
618 |
'edit_others_posts' => 'advanced_ads_edit_ads',
|
613 |
'edit_post' => 'advanced_ads_edit_ads',
|
614 |
'read_post' => 'advanced_ads_edit_ads',
|
615 |
'delete_post' => 'advanced_ads_edit_ads',
|
616 |
+
'edit_page' => 'advanced_ads_edit_ads',
|
617 |
+
'read_page' => 'advanced_ads_edit_ads',
|
618 |
+
'delete_page' => 'advanced_ads_edit_ads',
|
619 |
// Primitive capabilities used outside of map_meta_cap()
|
620 |
'edit_posts' => 'advanced_ads_edit_ads',
|
621 |
'edit_others_posts' => 'advanced_ads_edit_ads',
|
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, ad inserter, ad injection, ad manager, ads manager, ad widget, adrotate, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banners, buysellads, chitika, clickbank, dfp, doubleclick, geotarget, geolocation, geo location, google dfp, monetization, widget
|
5 |
Requires at least: WP 4.2, PHP 5.3
|
6 |
Tested up to: 4.5.2
|
7 |
-
Stable tag: 1.7.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -203,6 +203,18 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
|
|
203 |
|
204 |
== Changelog ==
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
= 1.7.4.1 =
|
207 |
|
208 |
* order ads in widgets and placements by ad title
|
4 |
Tags: ads, ad, ad inserter, ad injection, ad manager, ads manager, ad widget, adrotate, adsense, advertise, advertisements, advertising, adverts, advert, amazon, banner, banners, buysellads, chitika, clickbank, dfp, doubleclick, geotarget, geolocation, geo location, google dfp, monetization, widget
|
5 |
Requires at least: WP 4.2, PHP 5.3
|
6 |
Tested up to: 4.5.2
|
7 |
+
Stable tag: 1.7.4.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
203 |
|
204 |
== Changelog ==
|
205 |
|
206 |
+
= 1.7.4.2 =
|
207 |
+
|
208 |
+
* hide contrainer class, id and ad debug mode in Wizard
|
209 |
+
* fixed term query showing on every page impression
|
210 |
+
* fixed capabilities issue with Theia post slider
|
211 |
+
* fixed unnecessary admin notifications queries
|
212 |
+
* fixed ad title disappear when type was selected
|
213 |
+
* fixed ad group parameter layout
|
214 |
+
* fixed init hook to allow adding custom taxonomies
|
215 |
+
* ad meta boxes are now forced to be visible
|
216 |
+
* added link to advertisement label manual
|
217 |
+
|
218 |
= 1.7.4.1 =
|
219 |
|
220 |
* order ads in widgets and placements by ad title
|