Version Description
major changes:
- added advanced js functions (see some examples)
- moved taxonomies display condition to new layout
- rearranged the menu to fix its occasional disappearance
- added donation link donations are very welcome :)
Download this release
Release Info
Developer | webzunft |
Plugin | Advanced Ads |
Version | 1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.2 to 1.2.3
- admin/assets/css/admin.css +3 -1
- admin/class-advanced-ads-admin.php +35 -32
- admin/includes/class-display-condition-callbacks.php +83 -3
- admin/views/ad-display-metabox.php +0 -2
- advanced-ads.php +1 -1
- classes/ad.php +11 -3
- includes/array_ad_conditions.php +3 -2
- public/class-advanced-ads.php +6 -2
- readme.txt +18 -2
admin/assets/css/admin.css
CHANGED
@@ -29,9 +29,11 @@
|
|
29 |
.post-type-advanced_ads #advanced-ad-conditions {
|
30 |
text-align: left;
|
31 |
}
|
|
|
32 |
.post-type-advanced_ads #ad-display-box label { margin-right: 1em; }
|
33 |
.post-type-advanced_ads .advads-conditions-all { display: block; }
|
34 |
-
.post-type-advanced_ads .advads-conditions-single
|
|
|
35 |
.post-type-advanced_ads #advads-ad-content-plain {
|
36 |
width: 100%;
|
37 |
}
|
29 |
.post-type-advanced_ads #advanced-ad-conditions {
|
30 |
text-align: left;
|
31 |
}
|
32 |
+
.post-type-advanced_ads h5 { font-size: 1.2em; margin: 1em 0 .5em; }
|
33 |
.post-type-advanced_ads #ad-display-box label { margin-right: 1em; }
|
34 |
.post-type-advanced_ads .advads-conditions-all { display: block; }
|
35 |
+
.post-type-advanced_ads .advads-conditions-single { margin-bottom: 10px; padding: 10px; }
|
36 |
+
.post-type-advanced_ads .advads-conditions-single.disabled { display: none; opacity: .5; }
|
37 |
.post-type-advanced_ads #advads-ad-content-plain {
|
38 |
width: 100%;
|
39 |
}
|
admin/class-advanced-ads-admin.php
CHANGED
@@ -81,9 +81,7 @@ class Advanced_Ads_Admin {
|
|
81 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
82 |
|
83 |
// Add menu items
|
84 |
-
add_action('admin_menu', array($this, 'add_ad_group_menu'));
|
85 |
add_action('admin_menu', array($this, 'add_plugin_admin_menu'));
|
86 |
-
add_action('admin_init', array($this, 'organize_admin_menu'));
|
87 |
|
88 |
// on post/ad edit screen
|
89 |
add_action('edit_form_after_title', array($this, 'edit_form_below_title'));
|
@@ -193,36 +191,32 @@ class Advanced_Ads_Admin {
|
|
193 |
*/
|
194 |
public function add_plugin_admin_menu() {
|
195 |
|
196 |
-
// add overview page
|
|
|
|
|
|
|
|
|
197 |
add_submenu_page(
|
198 |
-
|
|
|
|
|
|
|
|
|
199 |
);
|
|
|
200 |
// add placements page
|
201 |
add_submenu_page(
|
202 |
-
|
203 |
);
|
204 |
// add settings page
|
205 |
$this->plugin_screen_hook_suffix = add_submenu_page(
|
206 |
-
|
207 |
);
|
208 |
add_submenu_page(
|
209 |
null, __('Advanced Ads Debugging', $this->plugin_slug), __('Debug', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-debug', array($this, 'display_plugin_debug_page')
|
210 |
);
|
211 |
}
|
212 |
|
213 |
-
/**
|
214 |
-
* push the overview page to the top of the advanced ads menu
|
215 |
-
*
|
216 |
-
* @global array $submenu
|
217 |
-
* @since 1.2.2
|
218 |
-
*/
|
219 |
-
public function organize_admin_menu(){
|
220 |
-
global $submenu;
|
221 |
-
$submenu['edit.php?post_type=advanced_ads'][1] = $submenu['edit.php?post_type=advanced_ads'][17];
|
222 |
-
unset($submenu['edit.php?post_type=advanced_ads'][17]);
|
223 |
-
ksort($submenu['edit.php?post_type=advanced_ads']);
|
224 |
-
}
|
225 |
-
|
226 |
/**
|
227 |
* Render the overview page
|
228 |
*
|
@@ -288,18 +282,6 @@ class Advanced_Ads_Admin {
|
|
288 |
include_once( 'views/debug.php' );
|
289 |
}
|
290 |
|
291 |
-
/**
|
292 |
-
* Register ad group taxonomy page
|
293 |
-
*
|
294 |
-
* @since 1.0.0
|
295 |
-
*/
|
296 |
-
public function add_ad_group_menu() {
|
297 |
-
|
298 |
-
$this->ad_group_hook_suffix = add_submenu_page(
|
299 |
-
'edit.php?post_type=' . Advanced_Ads::POST_TYPE_SLUG, __('Ad Groups', $this->plugin_slug), __('Groups', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-groups', array($this, 'ad_group_admin_page')
|
300 |
-
);
|
301 |
-
}
|
302 |
-
|
303 |
/**
|
304 |
* Render the ad group page
|
305 |
*
|
@@ -572,7 +554,7 @@ class Advanced_Ads_Admin {
|
|
572 |
$hook
|
573 |
);
|
574 |
|
575 |
-
// add setting fields
|
576 |
add_settings_field(
|
577 |
'hide-for-user-role',
|
578 |
__('Hide ads for logged in users', ADVADS_SLUG),
|
@@ -580,6 +562,14 @@ class Advanced_Ads_Admin {
|
|
580 |
$hook,
|
581 |
'advanced_ads_setting_section'
|
582 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
583 |
}
|
584 |
|
585 |
/**
|
@@ -617,6 +607,19 @@ class Advanced_Ads_Admin {
|
|
617 |
echo '<p class="description">'. __('Choose the lowest role a user must have in order to not see any ads.', ADVADS_SLUG) .'</p>';
|
618 |
}
|
619 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
620 |
/**
|
621 |
* save a global array with ad injection information
|
622 |
* runs every time for all ads a single ad is saved (but not on autosave)
|
81 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
82 |
|
83 |
// Add menu items
|
|
|
84 |
add_action('admin_menu', array($this, 'add_plugin_admin_menu'));
|
|
|
85 |
|
86 |
// on post/ad edit screen
|
87 |
add_action('edit_form_after_title', array($this, 'edit_form_below_title'));
|
191 |
*/
|
192 |
public function add_plugin_admin_menu() {
|
193 |
|
194 |
+
// add main menu item with overview page
|
195 |
+
add_menu_page(
|
196 |
+
__('Overview', $this->plugin_slug), __('Advanced Ads', $this->plugin_slug), 'manage_options', $this->plugin_slug, array($this, 'display_overview_page'), '', '58.74'
|
197 |
+
);
|
198 |
+
|
199 |
add_submenu_page(
|
200 |
+
$this->plugin_slug, __('Ads', $this->plugin_slug), __('Ads', $this->plugin_slug), 'manage_options', 'edit.php?post_type=' . Advanced_Ads::POST_TYPE_SLUG
|
201 |
+
);
|
202 |
+
|
203 |
+
$this->ad_group_hook_suffix = add_submenu_page(
|
204 |
+
$this->plugin_slug, __('Ad Groups', $this->plugin_slug), __('Groups', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-groups', array($this, 'ad_group_admin_page')
|
205 |
);
|
206 |
+
|
207 |
// add placements page
|
208 |
add_submenu_page(
|
209 |
+
$this->plugin_slug, __('Ad Placements', $this->plugin_slug), __('Placements', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-placements', array($this, 'display_placements_page')
|
210 |
);
|
211 |
// add settings page
|
212 |
$this->plugin_screen_hook_suffix = add_submenu_page(
|
213 |
+
$this->plugin_slug, __('Advanced Ads Settings', $this->plugin_slug), __('Settings', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-settings', array($this, 'display_plugin_settings_page')
|
214 |
);
|
215 |
add_submenu_page(
|
216 |
null, __('Advanced Ads Debugging', $this->plugin_slug), __('Debug', $this->plugin_slug), 'manage_options', $this->plugin_slug . '-debug', array($this, 'display_plugin_debug_page')
|
217 |
);
|
218 |
}
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
/**
|
221 |
* Render the overview page
|
222 |
*
|
282 |
include_once( 'views/debug.php' );
|
283 |
}
|
284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
/**
|
286 |
* Render the ad group page
|
287 |
*
|
554 |
$hook
|
555 |
);
|
556 |
|
557 |
+
// add setting fields for user role
|
558 |
add_settings_field(
|
559 |
'hide-for-user-role',
|
560 |
__('Hide ads for logged in users', ADVADS_SLUG),
|
562 |
$hook,
|
563 |
'advanced_ads_setting_section'
|
564 |
);
|
565 |
+
// add setting fields for advanced ads
|
566 |
+
add_settings_field(
|
567 |
+
'activate-advanced-js',
|
568 |
+
__('Use advanced JavaScript', ADVADS_SLUG),
|
569 |
+
array($this, 'render_settings_advanced_js'),
|
570 |
+
$hook,
|
571 |
+
'advanced_ads_setting_section'
|
572 |
+
);
|
573 |
}
|
574 |
|
575 |
/**
|
607 |
echo '<p class="description">'. __('Choose the lowest role a user must have in order to not see any ads.', ADVADS_SLUG) .'</p>';
|
608 |
}
|
609 |
|
610 |
+
/**
|
611 |
+
* render setting to display advanced js file
|
612 |
+
*
|
613 |
+
* @since 1.2.3
|
614 |
+
*/
|
615 |
+
public function render_settings_advanced_js(){
|
616 |
+
$options = Advanced_Ads::get_instance()->options();
|
617 |
+
$checked = (!empty($options['advanced-js'])) ? 1 : 0;
|
618 |
+
|
619 |
+
echo '<input id="advanced-ads-advanced-js" type="checkbox" value="1" name="advancedads[advanced-js]" '.checked($checked, 1, false).'>';
|
620 |
+
echo '<p class="description">'. sprintf(__('Only enable this if you can and want to use the advanced JavaScript functions described <a href="%s">here</a>.', ADVADS_SLUG), 'http://wpadvancedads.com/javascript-functions/') .'</p>';
|
621 |
+
}
|
622 |
+
|
623 |
/**
|
624 |
* save a global array with ad injection information
|
625 |
* runs every time for all ads a single ad is saved (but not on autosave)
|
admin/includes/class-display-condition-callbacks.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
class AdvAds_Display_Condition_Callbacks {
|
10 |
|
11 |
/**
|
12 |
-
*
|
13 |
*
|
14 |
* @param obj $ad ad object
|
15 |
* @since 1.2.2
|
@@ -24,9 +24,11 @@ class AdvAds_Display_Condition_Callbacks {
|
|
24 |
}
|
25 |
}
|
26 |
|
27 |
-
?><label class="advads-conditions-all"><input type="checkbox" name="advanced_ad[conditions][posttypes][all]" value="1" <?php checked($_all, 1); ?>><?php
|
|
|
28 |
$post_types = get_post_types(array('public' => true, 'publicly_queryable' => true), 'object', 'or');
|
29 |
-
?><
|
|
|
30 |
// backward compatibility
|
31 |
// TODO: remove in a later version
|
32 |
$_includes = (!empty($ad->conditions['posttypes']['include']) && is_string($ad->conditions['posttypes']['include'])) ? explode(',', $ad->conditions['posttypes']['include']) : array();
|
@@ -51,4 +53,82 @@ class AdvAds_Display_Condition_Callbacks {
|
|
51 |
}
|
52 |
?></div><?php
|
53 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
9 |
class AdvAds_Display_Condition_Callbacks {
|
10 |
|
11 |
/**
|
12 |
+
* render display condition for post types
|
13 |
*
|
14 |
* @param obj $ad ad object
|
15 |
* @since 1.2.2
|
24 |
}
|
25 |
}
|
26 |
|
27 |
+
?><h4><label class="advads-conditions-all"><input type="checkbox" name="advanced_ad[conditions][posttypes][all]" value="1" <?php checked($_all, 1); ?>><?php
|
28 |
+
_e('Display on all public <strong>post types</strong>.', ADVADS_SLUG); ?></label></h4><?php
|
29 |
$post_types = get_post_types(array('public' => true, 'publicly_queryable' => true), 'object', 'or');
|
30 |
+
?><p class="description"><?php _e('Choose the public post types on which to display the ad.', ADVADS_SLUG); ?></p>
|
31 |
+
<div class="advads-conditions-single"><?php
|
32 |
// backward compatibility
|
33 |
// TODO: remove in a later version
|
34 |
$_includes = (!empty($ad->conditions['posttypes']['include']) && is_string($ad->conditions['posttypes']['include'])) ? explode(',', $ad->conditions['posttypes']['include']) : array();
|
53 |
}
|
54 |
?></div><?php
|
55 |
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* render display condition for post types
|
59 |
+
*
|
60 |
+
* @param obj $ad ad object
|
61 |
+
* @since 1.2.3
|
62 |
+
*/
|
63 |
+
public static function terms($ad = false){
|
64 |
+
|
65 |
+
// set defaults
|
66 |
+
if(is_object($ad)){
|
67 |
+
$_all = (isset($ad->conditions['categoryids']['all'])) ? 1 : 0;
|
68 |
+
if(!$_all && !isset($ad->conditions['categoryids']['all']) && empty($ad->conditions['categoryids']['include']) && empty($ad->conditions['categoryids']['exclude'])){
|
69 |
+
$_all = 1;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
if(!empty($ad->conditions['categoryids']['include'])){
|
74 |
+
// backward compatibility
|
75 |
+
// TODO: remove in a later version; this should already be an array
|
76 |
+
if(is_string($ad->conditions['categoryids']['include'])){
|
77 |
+
$_includes = explode(',', $ad->conditions['categoryids']['include']);
|
78 |
+
} else {
|
79 |
+
$_includes = $ad->conditions['categoryids']['include'];
|
80 |
+
}
|
81 |
+
} else {
|
82 |
+
$_includes = array();
|
83 |
+
}
|
84 |
+
|
85 |
+
?><h4><label class="advads-conditions-all"><input type="checkbox" name="advanced_ad[conditions][categoryids][all]" value="1" <?php checked($_all, 1); ?>><?php
|
86 |
+
_e('Display for all <strong>categories, tags and taxonomies</strong>.', ADVADS_SLUG); ?></label></h4><?php
|
87 |
+
$taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true), 'objects', 'or');
|
88 |
+
?><div class="advads-conditions-single"><h5 class="header"><?php _e('Display here', ADVADS_SLUG); ?></h5><p class="description"><?php _e('Choose terms from public categories, tags and other taxonomies a post must belong to in order to have ads.', ADVADS_SLUG); ?></p>
|
89 |
+
<table><?php
|
90 |
+
foreach($taxonomies as $_tax):
|
91 |
+
if($_tax->name === 'advanced_ads_groups') continue; // exclude adv ads groups
|
92 |
+
$terms = get_terms($_tax->name, array());
|
93 |
+
if ( !empty( $terms ) && !is_wp_error( $terms ) ):
|
94 |
+
?><tr><th><?php echo $_tax->label; ?></th><?php
|
95 |
+
?><td><?php
|
96 |
+
foreach($terms as $_term) :
|
97 |
+
?><label><input type="checkbox" name="advanced_ad[conditions][categoryids][include][]" value="<?php echo $_term->term_id; ?>" <?php
|
98 |
+
checked(in_array($_term->term_id, $_includes), true); ?>><?php echo $_term->name; ?></label><?php
|
99 |
+
endforeach;
|
100 |
+
?></td></tr><?php
|
101 |
+
endif;
|
102 |
+
endforeach;
|
103 |
+
?></table><?php
|
104 |
+
|
105 |
+
if(!empty($ad->conditions['categoryids']['exclude'])){
|
106 |
+
// backward compatibility
|
107 |
+
// TODO: remove in a later version; this should already be an array
|
108 |
+
if(is_string($ad->conditions['categoryids']['exclude'])){
|
109 |
+
$_excludes = explode(',', $ad->conditions['categoryids']['exclude']);
|
110 |
+
} else {
|
111 |
+
$_excludes = $ad->conditions['categoryids']['exclude'];
|
112 |
+
}
|
113 |
+
} else {
|
114 |
+
$_excludes = array();
|
115 |
+
}
|
116 |
+
|
117 |
+
?><h5 class="header"><?php _e('Hide from here', ADVADS_SLUG); ?></h5><p class="description"><?php _e('Choose the terms from public categories, tags and other taxonomies a post must belong to hide the ad from it.', ADVADS_SLUG); ?></p>
|
118 |
+
<table><?php
|
119 |
+
foreach($taxonomies as $_tax):
|
120 |
+
if($_tax->name === 'advanced_ads_groups') continue; // exclude adv ads groups
|
121 |
+
$terms = get_terms($_tax->name, array());
|
122 |
+
if ( !empty( $terms ) && !is_wp_error( $terms ) ):
|
123 |
+
?><tr><th><?php echo $_tax->label; ?></th><?php
|
124 |
+
?><td><?php
|
125 |
+
foreach($terms as $_term) :
|
126 |
+
?><label><input type="checkbox" name="advanced_ad[conditions][categoryids][exclude][]" value="<?php echo $_term->term_id; ?>" <?php
|
127 |
+
checked(in_array($_term->term_id, $_excludes), true); ?>><?php echo $_term->name; ?></label><?php
|
128 |
+
endforeach;
|
129 |
+
?></td></tr><?php
|
130 |
+
endif;
|
131 |
+
endforeach;
|
132 |
+
?></table></div><?php
|
133 |
+
}
|
134 |
}
|
admin/views/ad-display-metabox.php
CHANGED
@@ -23,8 +23,6 @@ require_once(ADVADS_BASE_PATH . 'admin/includes/class-display-condition-callback
|
|
23 |
foreach ($advanced_ads_ad_conditions as $_key => $_condition) :
|
24 |
if(!isset($_condition['callback'])) continue;
|
25 |
?><div class="advanced-ad-display-condition">
|
26 |
-
<h4><?php echo $_condition['label']; ?></h4>
|
27 |
-
<p class="description"><?php echo $_condition['description']; ?></p>
|
28 |
<?php if(is_array($_condition['callback']) && method_exists($_condition['callback'][0], $_condition['callback'][1])) {
|
29 |
$_condition['callback'][0]::$_condition['callback'][1]($ad);
|
30 |
}
|
23 |
foreach ($advanced_ads_ad_conditions as $_key => $_condition) :
|
24 |
if(!isset($_condition['callback'])) continue;
|
25 |
?><div class="advanced-ad-display-condition">
|
|
|
|
|
26 |
<?php if(is_array($_condition['callback']) && method_exists($_condition['callback'][0], $_condition['callback'][1])) {
|
27 |
$_condition['callback'][0]::$_condition['callback'][1]($ad);
|
28 |
}
|
advanced-ads.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: http://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
-
* Version: 1.2.
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: http://webgilde.com
|
18 |
* Text Domain: advanced-ads
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: http://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
+
* Version: 1.2.3
|
16 |
* Author: Thomas Maier
|
17 |
* Author URI: http://webgilde.com
|
18 |
* Text Domain: advanced-ads
|
classes/ad.php
CHANGED
@@ -21,7 +21,7 @@ class Advads_Ad {
|
|
21 |
/**
|
22 |
* id of the post type for this ad
|
23 |
*/
|
24 |
-
|
25 |
|
26 |
/**
|
27 |
* true, if this is an Advanced Ads Ad post type
|
@@ -287,7 +287,11 @@ class Advads_Ad {
|
|
287 |
case 'categoryids' :
|
288 |
// included
|
289 |
if(!empty($_cond_value['include'])){
|
290 |
-
|
|
|
|
|
|
|
|
|
291 |
// check if currently in a post (not post page, but also posts in loops)
|
292 |
if(is_array($category_ids) && isset($post->ID)
|
293 |
&& !in_category($category_ids, $post)) {
|
@@ -296,7 +300,11 @@ class Advads_Ad {
|
|
296 |
}
|
297 |
// check for excluded category ids
|
298 |
if(!empty($_cond_value['exclude'])){
|
299 |
-
|
|
|
|
|
|
|
|
|
300 |
// check if currently in a post (not post page, but also posts in loops)
|
301 |
if(is_array($category_ids) && isset($post->ID)
|
302 |
&& in_category($category_ids, $post) ) {
|
21 |
/**
|
22 |
* id of the post type for this ad
|
23 |
*/
|
24 |
+
public $id = 0;
|
25 |
|
26 |
/**
|
27 |
* true, if this is an Advanced Ads Ad post type
|
287 |
case 'categoryids' :
|
288 |
// included
|
289 |
if(!empty($_cond_value['include'])){
|
290 |
+
if(is_string($_cond_value['include'])){
|
291 |
+
$category_ids = explode(',', $_cond_value['include']);
|
292 |
+
} else {
|
293 |
+
$category_ids = $_cond_value['include'];
|
294 |
+
}
|
295 |
// check if currently in a post (not post page, but also posts in loops)
|
296 |
if(is_array($category_ids) && isset($post->ID)
|
297 |
&& !in_category($category_ids, $post)) {
|
300 |
}
|
301 |
// check for excluded category ids
|
302 |
if(!empty($_cond_value['exclude'])){
|
303 |
+
if(is_string($_cond_value['exclude'])){
|
304 |
+
$category_ids = explode(',', $_cond_value['exclude']);
|
305 |
+
} else {
|
306 |
+
$category_ids = $_cond_value['exclude'];
|
307 |
+
}
|
308 |
// check if currently in a post (not post page, but also posts in loops)
|
309 |
if(is_array($category_ids) && isset($post->ID)
|
310 |
&& in_category($category_ids, $post) ) {
|
includes/array_ad_conditions.php
CHANGED
@@ -34,9 +34,10 @@ $advanced_ads_ad_conditions = array(
|
|
34 |
'type' => 'idfield',
|
35 |
),
|
36 |
'categoryids' => array(
|
37 |
-
'label' => __('Categories', $advanced_ads_slug),
|
38 |
-
'description' => __('
|
39 |
'type' => 'idfield',
|
|
|
40 |
),
|
41 |
'categoryarchiveids' => array(
|
42 |
'label' => __('Category Archives', $advanced_ads_slug),
|
34 |
'type' => 'idfield',
|
35 |
),
|
36 |
'categoryids' => array(
|
37 |
+
'label' => __('Categories, Tags and Taxonomies', $advanced_ads_slug),
|
38 |
+
'description' => __('Choose terms from public category, tag and other taxonomies a post must belong to in order to have ads.', $advanced_ads_slug),
|
39 |
'type' => 'idfield',
|
40 |
+
'callback' => array('AdvAds_Display_Condition_Callbacks', 'terms')
|
41 |
),
|
42 |
'categoryarchiveids' => array(
|
43 |
'label' => __('Category Archives', $advanced_ads_slug),
|
public/class-advanced-ads.php
CHANGED
@@ -25,7 +25,7 @@ class Advanced_Ads {
|
|
25 |
* @var string
|
26 |
*/
|
27 |
|
28 |
-
const VERSION = '1.2.
|
29 |
|
30 |
/**
|
31 |
* post type slug
|
@@ -313,6 +313,10 @@ class Advanced_Ads {
|
|
313 |
*/
|
314 |
public function enqueue_scripts() {
|
315 |
// wp_enqueue_script($this->plugin_slug . '-plugin-script', plugins_url('assets/js/public.js', __FILE__), array('jquery'), self::VERSION);
|
|
|
|
|
|
|
|
|
316 |
}
|
317 |
|
318 |
/**
|
@@ -538,7 +542,7 @@ class Advanced_Ads {
|
|
538 |
'singular_label' => __('Ad', $this->plugin_slug),
|
539 |
'public' => false,
|
540 |
'show_ui' => true,
|
541 |
-
'
|
542 |
'hierarchical' => false,
|
543 |
'capability_type' => 'page',
|
544 |
'has_archive' => false,
|
25 |
* @var string
|
26 |
*/
|
27 |
|
28 |
+
const VERSION = '1.2.3';
|
29 |
|
30 |
/**
|
31 |
* post type slug
|
313 |
*/
|
314 |
public function enqueue_scripts() {
|
315 |
// wp_enqueue_script($this->plugin_slug . '-plugin-script', plugins_url('assets/js/public.js', __FILE__), array('jquery'), self::VERSION);
|
316 |
+
$options = $this->options();
|
317 |
+
if(!empty($options['advanced-js'])){
|
318 |
+
wp_enqueue_script($this->plugin_slug . '-advanced-js', plugins_url('assets/js/advanced.js', __FILE__), array('jquery'), self::VERSION);
|
319 |
+
}
|
320 |
}
|
321 |
|
322 |
/**
|
542 |
'singular_label' => __('Ad', $this->plugin_slug),
|
543 |
'public' => false,
|
544 |
'show_ui' => true,
|
545 |
+
'show_in_menu' => false,
|
546 |
'hierarchical' => false,
|
547 |
'capability_type' => 'page',
|
548 |
'has_archive' => false,
|
readme.txt
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
=== Advanced Ads ===
|
2 |
Contributors: webzunft
|
|
|
3 |
Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
|
4 |
Requires at least: 3.5
|
5 |
Tested up to: 4.0.0
|
6 |
-
Stable tag: 1.2.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -133,9 +134,18 @@ There is no revenue share. Advanced Ads doesn’t alter your ad codes in a way t
|
|
133 |
|
134 |
== Changelog ==
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
= 1.2.2 =
|
137 |
|
138 |
-
major changes
|
139 |
|
140 |
* added overview page
|
141 |
* new layout for display condition check for post types
|
@@ -216,3 +226,9 @@ other fixes:
|
|
216 |
|
217 |
= 1.0 =
|
218 |
* first release
|
|
|
|
|
|
|
|
|
|
|
|
1 |
=== Advanced Ads ===
|
2 |
Contributors: webzunft
|
3 |
+
Donate link:https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5RRRCEBGN3UT2
|
4 |
Tags: ads, ad, adsense, display, banner, advertisements, adverts, advert, monetization
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.0.0
|
7 |
+
Stable tag: 1.2.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
134 |
|
135 |
== Changelog ==
|
136 |
|
137 |
+
= 1.2.3 =
|
138 |
+
|
139 |
+
major changes:
|
140 |
+
|
141 |
+
* added advanced js functions ([see some examples](http://wpadvancedads.com/javascript-functions/))
|
142 |
+
* moved taxonomies display condition to new layout
|
143 |
+
* rearranged the menu to fix its occasional disappearance
|
144 |
+
* added donation link – donations are very welcome :)
|
145 |
+
|
146 |
= 1.2.2 =
|
147 |
|
148 |
+
major changes:
|
149 |
|
150 |
* added overview page
|
151 |
* new layout for display condition check for post types
|
226 |
|
227 |
= 1.0 =
|
228 |
* first release
|
229 |
+
|
230 |
+
== Upgrade Notice ==
|
231 |
+
|
232 |
+
= 1.2.3 =
|
233 |
+
|
234 |
+
Fixes a bug with the missing menu item
|