44Plugin URI: http://automattic.com
55Description: Easy ad code management
66Author: Rinat Khaziev, Jeremy Felt, Daniel Bachhuber, Automattic, doejo
7- Version: 0.2
7+ Version: 0.2.1
88Author URI: http://automattic.com
99
1010GNU General Public License, Free Software Foundation <http://creativecommons.org/licenses/GPL/2.0/>
2424Foundation, 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 ' );
2828define ( 'AD_CODE_MANAGER_ROOT ' , dirname ( __FILE__ ) );
2929define ( 'AD_CODE_MANAGER_FILE_PATH ' , AD_CODE_MANAGER_ROOT . '/ ' . basename ( __FILE__ ) );
3030define ( '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 ;
0 commit comments