| 1 |
<?php |
| 2 |
/** |
| 3 |
* Includes deprecated functions |
| 4 |
* @deprecated since 1.9.0 |
| 5 |
* @todo remove after 01.03.2017 |
| 6 |
*/ |
| 7 |
|
| 8 |
/* Renaming old version options name */ |
| 9 |
if ( ! function_exists( 'pdfprnt_check_old_options' ) ) { |
| 10 |
function pdfprnt_check_old_options() { |
| 11 |
if ( is_multisite() ) { |
| 12 |
global $wpdb; |
| 13 |
if ( $old_options = get_site_option( 'pdfprnt_options_array' ) ) { |
| 14 |
if ( ! get_site_option( 'pdfprnt_options' ) ) |
| 15 |
add_site_option( 'pdfprnt_options', $old_options ); |
| 16 |
else |
| 17 |
update_site_option( 'pdfprnt_options', $old_options ); |
| 18 |
delete_site_option( 'pdfprnt_options_array' ); |
| 19 |
} |
| 20 |
$blogids = $wpdb->get_col( "SELECT `blog_id` FROM $wpdb->blogs" ); |
| 21 |
$old_blog = $wpdb->blogid; |
| 22 |
foreach ( $blogids as $blog_id ) { |
| 23 |
switch_to_blog( $blog_id ); |
| 24 |
if ( $old_options = get_option( 'pdfprnt_options_array' ) ) { |
| 25 |
if ( ! get_option( 'pdfprnt_options' ) ) |
| 26 |
add_option( 'pdfprnt_options', $old_options ); |
| 27 |
else |
| 28 |
update_option( 'pdfprnt_options', $old_options ); |
| 29 |
delete_option( 'pdfprnt_options_array' ); |
| 30 |
} |
| 31 |
} |
| 32 |
switch_to_blog( $old_blog ); |
| 33 |
} else { |
| 34 |
if ( $old_options = get_option( 'pdfprnt_options_array' ) ) { |
| 35 |
if ( ! get_option( 'pdfprnt_options' ) ) |
| 36 |
add_option( 'pdfprnt_options', $old_options ); |
| 37 |
else |
| 38 |
update_option( 'pdfprnt_options', $old_options ); |
| 39 |
delete_option( 'pdfprnt_options_array' ); |
| 40 |
} |
| 41 |
} |
| 42 |
} |
| 43 |
} |
| 44 |
|