Skip to content

Commit 628a544

Browse files
Merge branch 'develop'
2 parents 7c1cf0d + 14b9127 commit 628a544

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

ad-code-manager.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin URI: http://automattic.com
55
Description: Easy ad code management
66
Author: Rinat Khaziev, Jeremy Felt, Daniel Bachhuber, Automattic, doejo
7-
Version: 0.2
7+
Version: 0.2.1
88
Author URI: http://automattic.com
99
1010
GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
@@ -24,7 +24,7 @@
2424
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2525
2626
*/
27-
define( 'AD_CODE_MANAGER_VERSION', '0.2' );
27+
define( 'AD_CODE_MANAGER_VERSION', '0.2.1' );
2828
define( 'AD_CODE_MANAGER_ROOT' , dirname( __FILE__ ) );
2929
define( 'AD_CODE_MANAGER_FILE_PATH' , AD_CODE_MANAGER_ROOT . '/' . basename( __FILE__ ) );
3030
define( 'AD_CODE_MANAGER_URL' , plugins_url( '/', __FILE__ ) );
@@ -258,6 +258,7 @@ function handle_admin_action() {
258258
$this->edit_conditionals( $id, $new_conditionals );
259259
$message = 'ad-code-updated';
260260
}
261+
$this->flush_cache();
261262
break;
262263
case 'delete':
263264
$id = (int)$_REQUEST['id'];
@@ -322,11 +323,14 @@ function get_ad_codes( $query_args = array() ) {
322323
foreach ( $this->current_provider->columns as $slug => $title ) {
323324
$provider_url_vars[$slug] = get_post_meta( $ad_code_cpt->ID, $slug, true );
324325
}
326+
327+
$priority = get_post_meta( $ad_code_cpt->ID, 'priority', true );
328+
$priority = ( !empty( $priority ) ) ? intval( $priority ) : 10;
325329

326330
$ad_codes_formatted[] = array(
327331
'conditionals' => $this->get_conditionals( $ad_code_cpt->ID ),
328332
'url_vars' => $provider_url_vars,
329-
'priority' => get_post_meta( $ad_code_cpt->ID, 'priority', true ),
333+
'priority' => $priority,
330334
'post_id' => $ad_code_cpt->ID
331335
);
332336
}
@@ -351,11 +355,14 @@ function get_ad_code( $post_id ) {
351355
foreach ( $this->current_provider->columns as $slug => $title ) {
352356
$provider_url_vars[$slug] = get_post_meta( $post->ID, $slug, true );
353357
}
358+
359+
$priority = get_post_meta( $post_id, 'priority', true );
360+
$priority = ( !empty( $priority ) ) ? intval( $priority ) : 10;
354361

355362
$ad_code_formatted = array(
356363
'conditionals' => $this->get_conditionals( $post->ID ),
357364
'url_vars' => $provider_url_vars,
358-
'priority' => get_post_meta( $post->ID, 'priority', true ),
365+
'priority' => $priority,
359366
'post_id' => $post->ID
360367
);
361368
return $ad_code_formatted;

readme.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: rinatkhaziev, jeremyfelt, zztimur, danielbachhuber, automattic, do
33
Tags: advertising, ad codes
44
Requires at least: 3.1
55
Tested up to: 3.3.2
6-
Stable tag: 0.2
6+
Stable tag: 0.2.1
77

88
Manage your ad codes through the WordPress admin in a safe and easy way.
99

@@ -267,8 +267,17 @@ Example usage:
267267
1. Edit existing ad codes inline through the admin interface.
268268
1. Example of ad tag in use in a theme header template.
269269

270+
== Upgrade Notice ==
271+
272+
= 0.2.1 =
273+
Flush the cache when adding or deleting ad codes, and set priority of 10 when a priority doesn't exist for an ad code.
274+
270275
== Changelog ==
271276

277+
= 0.2.1 (May 14, 2012) =
278+
* Flush the cache whenever an ad code is created or deleted so you don't have to wait for a timeout with persistent cache
279+
* Bug fix: Default to priority 10 when querying for ad codes if there is no priority set
280+
272281
= 0.2 (May 7, 2012) =
273282
* UI reworked from the ground up to look and work much more like the WordPress admin (using WP List Table)
274283
* Abstracted ad network logic, so users can integrate other ad networks. Pull requests to add support to the plugin are always welcome

0 commit comments

Comments
 (0)