migrate_options(); } /** * Migrate options. * * @since 7.11 * @access protected */ protected function migrate_options() { $available_langs = self::$available_languages; $options = get_option( $this->option_name, [] ); $options = $this->set_totop_options( $options ); $options = $this->set_alert_options( $options ); update_option( $this->option_name, $options ); foreach ( $available_langs as $language ) { // Skip langs that are already done. if ( '' === $language ) { continue; } $options = get_option( $this->option_name . '_' . $language, [] ); $options = $this->set_totop_options( $options ); $options = $this->set_alert_options( $options ); update_option( $this->option_name . '_' . $language, $options ); } } /** * Sets link hover color option as default totop hover. * * @access private * @since 7.11 * @param array $options The Global Options array. * @return array The updated Global Options array. */ private function set_totop_options( $options ) { if ( isset( $options['link_hover_color'] ) ) { $options['totop_background_hover'] = $options['link_hover_color']; } $options['totop_background'] = '#333333'; $options['totop_icon_color'] = '#ffffff'; $options['totop_icon_hover'] = '#ffffff'; return $options; } /** * Sets link hover color option as default totop hover. * * @access private * @since 7.10.2 * @param array $options The Global Options array. * @return array The updated Global Options array. */ private function set_alert_options( $options ) { if ( isset( $options['alert_box_dismissable'] ) && 'yes' === $options['alert_box_dismissable'] ) { $options['alert_box_dismissable'] = 'boxed'; } return $options; } }