| 1 |
<?php |
| 2 |
namespace MasterAddons\Inc\Classes; |
| 3 |
|
| 4 |
if (!defined('ABSPATH')) { |
| 5 |
exit; // Exit if accessed directly |
| 6 |
} |
| 7 |
|
| 8 |
function jltma_update_icon_libraries_settings_key() |
| 9 |
{ |
| 10 |
$jltma_settings_key = get_option('jltma_icons_library_save_settings', ''); |
| 11 |
|
| 12 |
if (!empty($jltma_settings_key)) { |
| 13 |
if (!empty($jltma_settings_key['admin_general_button_color'])) { |
| 14 |
$button_colors = $jltma_settings_key['admin_general_button_color']; |
| 15 |
|
| 16 |
$new_button_colors = [ |
| 17 |
'primary_color' => '#0347FF', |
| 18 |
'secondary_color' => '#fff', |
| 19 |
]; |
| 20 |
|
| 21 |
if (is_array($button_colors) && array_key_exists('bg_color', $button_colors)) { |
| 22 |
$new_button_colors['primary_color'] = esc_attr($button_colors['bg_color']); |
| 23 |
} |
| 24 |
if (is_array($button_colors) && array_key_exists('text_color', $button_colors)) { |
| 25 |
$new_button_colors['secondary_color'] = esc_attr($button_colors['text_color']); |
| 26 |
} |
| 27 |
|
| 28 |
$jltma_settings_key['admin_general_button_color'] = $new_button_colors; |
| 29 |
|
| 30 |
update_option('jltma_icons_library_save_settings', $jltma_settings_key); |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
jltma_update_icon_libraries_settings_key(); |
| 35 |
|
| 36 |
|
| 37 |
// update version once migration is completed. |
| 38 |
update_option($this->option_name, $version); |
| 39 |
|