| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
|
| 5 |
$pluginversion = get_option('avcp_version_number'); |
| 6 |
|
| 7 |
//In questo blocco sono impostati i vari aggiornamenti ad alcuni campi del database che vanno modificati per poter eseguire la versione relativa all'aggiornamento stesso... |
| 8 |
|
| 9 |
if (version_compare($pluginversion, "3.1", "<")) { |
| 10 |
avcp_activate(); |
| 11 |
} |
| 12 |
|
| 13 |
if (version_compare($pluginversion, "3.2", "<")) { |
| 14 |
query_posts( array( 'post_type' => 'avcp', 'posts_per_page' => '-1') ); global $post; |
| 15 |
if ( have_posts() ) : while ( have_posts() ) : the_post(); |
| 16 |
$tip_contraente = get_post_meta($post->ID, 'avcp_contraente', true); |
| 17 |
if ($tip_contraente == '25-AFFIDAMENTO DIRETTO A SOCIETA') { |
| 18 |
update_post_meta($post->ID, 'avcp_contraente', '25-AFFIDAMENTO DIRETTO A SOCIETA' RAGGRUPPATE/CONSORZIATE O CONTROLLATE NELLE CONCESSIONI DI LL.PP'); |
| 19 |
} else if ($tip_contraente == '24-AFFIDAMENTO DIRETTO A SOCIETA') { |
| 20 |
update_post_meta($post->ID, 'avcp_contraente', '24-AFFIDAMENTO DIRETTO A SOCIETA' IN HOUSE'); |
| 21 |
} |
| 22 |
endwhile; else: |
| 23 |
endif; |
| 24 |
creafilexml ('2013'); |
| 25 |
creafilexml ('2014'); |
| 26 |
} |
| 27 |
|
| 28 |
if (version_compare($pluginversion, "4.2", "<")) { |
| 29 |
global $current_user; |
| 30 |
$user_id = $current_user->ID; |
| 31 |
delete_user_meta($user_id, 'avcp_upgrade_3', 'true', true); |
| 32 |
avcp_activate(); |
| 33 |
} |
| 34 |
|
| 35 |
if (version_compare($pluginversion, "5.1", "<")) { |
| 36 |
creafilexml('2013'); |
| 37 |
creafilexml('2014'); |
| 38 |
creafilexml('2015'); |
| 39 |
} |
| 40 |
|
| 41 |
if (version_compare($pluginversion, "5.2", "<")) { |
| 42 |
delete_option('avcp_showxml'); |
| 43 |
delete_option('avcp_tab_jqueryui'); |
| 44 |
delete_option('avcp_export'); |
| 45 |
} |
| 46 |
|
| 47 |
if (version_compare($pluginversion, "6.4", "<")) { |
| 48 |
delete_option('avcp_showlove'); |
| 49 |
delete_option('avcp_enable_editor'); |
| 50 |
} |
| 51 |
|
| 52 |
anac_add_log('Script di aggiornamento '.$pluginversion.' richiamato', 0); |
| 53 |
?> |
| 54 |
|