diff --git a/ad-code-manager.php b/ad-code-manager.php index 9c6e5bc..e2f9a55 100644 --- a/ad-code-manager.php +++ b/ad-code-manager.php @@ -4,7 +4,7 @@ Plugin URI: http://automattic.com Description: Easy ad code management Author: Rinat Khaziev, Jeremy Felt, Daniel Bachhuber, Automattic, doejo -Version: 0.2 +Version: 0.2.1 Author URI: http://automattic.com GNU General Public License, Free Software Foundation @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -define( 'AD_CODE_MANAGER_VERSION', '0.2' ); +define( 'AD_CODE_MANAGER_VERSION', '0.2.1' ); define( 'AD_CODE_MANAGER_ROOT' , dirname( __FILE__ ) ); define( 'AD_CODE_MANAGER_FILE_PATH' , AD_CODE_MANAGER_ROOT . '/' . basename( __FILE__ ) ); define( 'AD_CODE_MANAGER_URL' , plugins_url( '/', __FILE__ ) ); @@ -258,6 +258,7 @@ function handle_admin_action() { $this->edit_conditionals( $id, $new_conditionals ); $message = 'ad-code-updated'; } + $this->flush_cache(); break; case 'delete': $id = (int)$_REQUEST['id']; @@ -322,11 +323,14 @@ function get_ad_codes( $query_args = array() ) { foreach ( $this->current_provider->columns as $slug => $title ) { $provider_url_vars[$slug] = get_post_meta( $ad_code_cpt->ID, $slug, true ); } + + $priority = get_post_meta( $ad_code_cpt->ID, 'priority', true ); + $priority = ( !empty( $priority ) ) ? intval( $priority ) : 10; $ad_codes_formatted[] = array( 'conditionals' => $this->get_conditionals( $ad_code_cpt->ID ), 'url_vars' => $provider_url_vars, - 'priority' => get_post_meta( $ad_code_cpt->ID, 'priority', true ), + 'priority' => $priority, 'post_id' => $ad_code_cpt->ID ); } @@ -351,11 +355,14 @@ function get_ad_code( $post_id ) { foreach ( $this->current_provider->columns as $slug => $title ) { $provider_url_vars[$slug] = get_post_meta( $post->ID, $slug, true ); } + + $priority = get_post_meta( $post_id, 'priority', true ); + $priority = ( !empty( $priority ) ) ? intval( $priority ) : 10; $ad_code_formatted = array( 'conditionals' => $this->get_conditionals( $post->ID ), 'url_vars' => $provider_url_vars, - 'priority' => get_post_meta( $post->ID, 'priority', true ), + 'priority' => $priority, 'post_id' => $post->ID ); return $ad_code_formatted; diff --git a/readme.txt b/readme.txt index f151b9e..342f4e1 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: rinatkhaziev, jeremyfelt, zztimur, danielbachhuber, automattic, do Tags: advertising, ad codes Requires at least: 3.1 Tested up to: 3.3.2 -Stable tag: 0.2 +Stable tag: 0.2.1 Manage your ad codes through the WordPress admin in a safe and easy way. @@ -267,8 +267,17 @@ Example usage: 1. Edit existing ad codes inline through the admin interface. 1. Example of ad tag in use in a theme header template. +== Upgrade Notice == + += 0.2.1 = +Flush the cache when adding or deleting ad codes, and set priority of 10 when a priority doesn't exist for an ad code. + == Changelog == += 0.2.1 (May 14, 2012) = +* Flush the cache whenever an ad code is created or deleted so you don't have to wait for a timeout with persistent cache +* Bug fix: Default to priority 10 when querying for ad codes if there is no priority set + = 0.2 (May 7, 2012) = * UI reworked from the ground up to look and work much more like the WordPress admin (using WP List Table) * Abstracted ad network logic, so users can integrate other ad networks. Pull requests to add support to the plugin are always welcome