Astra_Addon_Update::v_1_4_0_beta_5()

Update options of older version than 1.4.0-beta.5


Description

Mobile header alignment options Primary Menu, Above Header Menu and Below Header menu background color moved into responsive background image option


Source

File: classes/class-astra-addon-update.php

		public static function v_1_4_0_beta_5() {

			$astra_options = get_option( 'astra-settings', array() );

			if ( ! isset( $astra_options['above-header-menu-align'] ) ) {
				$astra_options['above-header-menu-align'] = 'inline';
			}

			if ( ! isset( $astra_options['below-header-menu-align'] ) ) {
				$astra_options['below-header-menu-align'] = 'inline';
			}

			// Primary menu background color.
			if ( isset( $astra_options['primary-menu-bg-color-responsive']['desktop'] ) ) {
				$astra_options['primary-menu-bg-obj-responsive']['desktop'] = array(
					'background-color'      => $astra_options['primary-menu-bg-color-responsive']['desktop'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}
			if ( isset( $astra_options['primary-menu-bg-color-responsive']['tablet'] ) ) {
				$astra_options['primary-menu-bg-obj-responsive']['tablet'] = array(
					'background-color'      => $astra_options['primary-menu-bg-color-responsive']['tablet'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}
			if ( isset( $astra_options['primary-menu-bg-color-responsive']['mobile'] ) ) {
				$astra_options['primary-menu-bg-obj-responsive']['mobile'] = array(
					'background-color'      => $astra_options['primary-menu-bg-color-responsive']['mobile'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}

			// Above header menu background color.
			if ( isset( $astra_options['above-header-menu-bg-color']['desktop'] ) ) {
				$astra_options['above-header-menu-bg-obj-responsive']['desktop'] = array(
					'background-color'      => $astra_options['above-header-menu-bg-color']['desktop'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);

			}
			if ( isset( $astra_options['above-header-menu-bg-color']['tablet'] ) ) {
				$astra_options['above-header-menu-bg-obj-responsive']['tablet'] = array(
					'background-color'      => $astra_options['above-header-menu-bg-color']['tablet'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}
			if ( isset( $astra_options['above-header-menu-bg-color']['mobile'] ) ) {
				$astra_options['above-header-menu-bg-obj-responsive']['mobile'] = array(
					'background-color'      => $astra_options['above-header-menu-bg-color']['mobile'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}

			// Below header menu background color.
			if ( isset( $astra_options['below-header-menu-bg-color']['desktop'] ) ) {
					$astra_options['below-header-menu-bg-obj-responsive']['desktop'] = array(
						'background-color'      => $astra_options['below-header-menu-bg-color']['desktop'],
						'background-image'      => '',
						'background-repeat'     => 'no-repeat',
						'background-position'   => 'center center',
						'background-size'       => 'cover',
						'background-attachment' => 'scroll',
					);
			}
			if ( isset( $astra_options['below-header-menu-bg-color']['tablet'] ) ) {
				$astra_options['below-header-menu-bg-obj-responsive']['tablet'] = array(
					'background-color'      => $astra_options['below-header-menu-bg-color']['tablet'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}
			if ( isset( $astra_options['below-header-menu-bg-color']['mobile'] ) ) {
				$astra_options['below-header-menu-bg-obj-responsive']['mobile'] = array(
					'background-color'      => $astra_options['below-header-menu-bg-color']['mobile'],
					'background-image'      => '',
					'background-repeat'     => 'no-repeat',
					'background-position'   => 'center center',
					'background-size'       => 'cover',
					'background-attachment' => 'scroll',
				);
			}

			// Set Above Header menu style fill for older version users.
			if ( ! isset( $astra_options['mobile-above-header-toggle-btn-style'] ) ) {
				$astra_options['mobile-above-header-toggle-btn-style'] = 'fill';
			}

			// Set Below Header menu style fill for older version users.
			if ( ! isset( $astra_options['mobile-below-header-toggle-btn-style'] ) ) {
				$astra_options['mobile-below-header-toggle-btn-style'] = 'fill';
			}

			update_option( 'astra-settings', $astra_options );

			self::update_header_layout_opts();
		}

Changelog

Changelog
Version Description
1.4.0-beta.5 Introduced.

User Contributed Notes

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