function upgrade_ssba($arrSettings) { // ensure excerpts are set add_option('ssba_excerpts', ''); // add print button add_option('ssba_custom_print', ''); // new for 3.8 add_option('ssba_widget_text', ''); add_option('ssba_rel_nofollow', ''); // added pre 4.5, added in 4.6 to fix notice add_option('ssba_rel_nofollow', ''); // added in 5.0 add_option('ssba_custom_vk', ''); add_option('ssba_custom_yummly', ''); // added in 5.2 add_option('ssba_default_pinterest', ''); // added in 5.5 add_option('ssba_pinterest_featured', ''); // added in 5.7 // additional CSS field add_option('ssba_additional_css', ''); // empty custom CSS var and option $customCSS = ''; add_option('ssba_custom_styles_enabled', ''); // if some custom styles are in place if ($arrSettings['ssba_custom_styles'] != '') { $customCSS .= $arrSettings['ssba_custom_styles']; update_option('ssba_custom_styles_enabled', 'Y'); } // if some custom share count styles are in place if ($arrSettings['ssba_share_count_css'] != '') { $customCSS .= $arrSettings['ssba_share_count_css']; update_option('ssba_custom_styles_enabled', 'Y'); } // update custom CSS option update_option('ssba_custom_styles', $customCSS); add_option('ssba_content_priority', '10'); // button helper array ssba_button_helper_array(); // update version number update_option('ssba_version', SSBA_VERSION); }
function upgrade_ssba($arrSettings, $version) { // if version is less than 6.0.5 if ($version < '6.0.5') { // ensure excerpts are set add_option('ssba_excerpts', ''); // add print button add_option('ssba_custom_print', ''); // new for 3.8 add_option('ssba_widget_text', ''); add_option('ssba_rel_nofollow', ''); // added pre 4.5, added in 4.6 to fix notice add_option('ssba_rel_nofollow', ''); // added in 5.0 add_option('ssba_custom_vk', ''); add_option('ssba_custom_yummly', ''); // added in 5.2 add_option('ssba_default_pinterest', ''); // added in 5.5 add_option('ssba_pinterest_featured', ''); // added in 5.7 // additional CSS field add_option('ssba_additional_css', ''); // empty custom CSS var and option $customCSS = ''; add_option('ssba_custom_styles_enabled', ''); // if some custom styles are in place if ($arrSettings['ssba_custom_styles'] != '') { $customCSS .= $arrSettings['ssba_custom_styles']; update_option('ssba_custom_styles_enabled', 'Y'); } // if some custom share count styles are in place if ($arrSettings['ssba_share_count_css'] != '') { $customCSS .= $arrSettings['ssba_share_count_css']; update_option('ssba_custom_styles_enabled', 'Y'); } // update custom CSS option update_option('ssba_custom_styles', $customCSS); // content priority add_option('ssba_content_priority', '10'); } // if version is less than 6.0.6 if ($version < '6.0.6') { // get old settings $oldSettings = get_old_ssba_settings(); // json encode old settings $jsonSettings = json_encode($oldSettings); // insert all options for ssba as json add_option('ssba_settings', $jsonSettings); // delete old options ssba_delete_old_options(); } // button helper array ssba_button_helper_array(); // update version number update_option('ssba_version', SSBA_VERSION); }