migrate_options(); } /** * Migrate options. * * @since 7.1 * @access protected */ protected function migrate_options() { $available_langs = self::$available_languages; $options = get_option( $this->option_name, [] ); $options = $this->title_margins( $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->title_margins( $options ); update_option( $this->option_name . '_' . $language, $options ); } } /** * Add left and right 0px margins for titles. * * @access private * @since 7.3 * @param array $options The Global Options array. * @return array The updated Global Options array. */ private function title_margins( $options ) { if ( isset( $options['title_margin'] ) && is_array( $options['title_margin'] ) ) { $options['title_margin']['left'] = '0px'; $options['title_margin']['right'] = '0px'; } if ( isset( $options['title_margin_mobile'] ) && is_array( $options['title_margin_mobile'] ) ) { $options['title_margin_mobile']['left'] = '0px'; $options['title_margin_mobile']['right'] = '0px'; } return $options; } }