Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed May 15, 2012
2 parents 7c1cf0d + 14b9127 commit 628a544
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
15 changes: 11 additions & 4 deletions ad-code-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://creativecommons.org/licenses/GPL/2.0/>
Expand All @@ -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__ ) );
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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
);
}
Expand All @@ -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;
Expand Down
11 changes: 10 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 628a544

Please sign in to comment.