astra_theme_background_updater_4_4_0()

Handle backward compatibility on version 4.6.0


Description


Return

(void)


Source

File: inc/theme-update/astra-update-functions.php

function astra_theme_background_updater_4_4_0() {
	$theme_options = get_option( 'astra-settings', array() );
	if ( ! isset( $theme_options['v4-4-0-backward-option'] ) ) {
		$theme_options['v4-4-0-backward-option'] = false;

		// Migrate primary button outline styles to secondary buttons.
		if ( isset( $theme_options['font-family-button'] ) ) {
			$theme_options['secondary-font-family-button'] = $theme_options['font-family-button'];
		}
		if ( isset( $theme_options['font-size-button'] ) ) {
			$theme_options['secondary-font-size-button'] = $theme_options['font-size-button'];
		}
		if ( isset( $theme_options['font-weight-button'] ) ) {
			$theme_options['secondary-font-weight-button'] = $theme_options['font-weight-button'];
		}
		if ( isset( $theme_options['font-extras-button'] ) ) {
			$theme_options['secondary-font-extras-button'] = $theme_options['font-extras-button'];
		}
		if ( isset( $theme_options['button-bg-color'] ) ) {
			$theme_options['secondary-button-bg-color'] = $theme_options['button-bg-color'];
		}
		if ( isset( $theme_options['button-bg-h-color'] ) ) {
			$theme_options['secondary-button-bg-h-color'] = $theme_options['button-bg-h-color'];
		}
		if ( isset( $theme_options['theme-button-border-group-border-color'] ) ) {
			$theme_options['secondary-theme-button-border-group-border-color'] = $theme_options['theme-button-border-group-border-color'];
		}
		if ( isset( $theme_options['theme-button-border-group-border-h-color'] ) ) {
			$theme_options['secondary-theme-button-border-group-border-h-color'] = $theme_options['theme-button-border-group-border-h-color'];
		}
		if ( isset( $theme_options['button-radius-fields'] ) ) {
			$theme_options['secondary-button-radius-fields'] = $theme_options['button-radius-fields'];
		}

		// Single - Article Featured Image visibility migration.
		$post_types = Astra_Posts_Structure_Loader::get_supported_post_types();
		foreach ( $post_types as $index => $post_type ) {
			$theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-article-featured-image-position-layout-1' ] = 'none';
			$theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-article-featured-image-position-layout-2' ] = 'none';
			$theme_options[ 'ast-dynamic-single-' . esc_attr( $post_type ) . '-article-featured-image-ratio-type' ]        = 'default';
		}

		update_option( 'astra-settings', $theme_options );
	}
}

Changelog

Changelog
Version Description
4.4.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.