Astra_Addon_Update::v_1_6_0_beta_4()

Update options when updating to v1.6.0-beta.4 Header Sections Submenu Border width Header Sections Pointer animation default value


Description


Return

(void)


Source

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

		public static function v_1_6_0_beta_4() {

			$border_disabled_values        = array(
				'top'    => '0',
				'bottom' => '0',
				'left'   => '0',
				'right'  => '0',
			);
			$inside_border_disabled_values = array(
				'bottom' => '0',
			);
			$border_enabled_values         = array(
				'top'    => '1',
				'bottom' => '1',
				'left'   => '1',
				'right'  => '1',
			);
			$inside_border_enabled_values  = array(
				'bottom' => '1',
			);

			$theme_options = get_option( 'astra-settings' );

			$above_submenu_border = isset( $theme_options['above-header-submenu-border'] ) ? $theme_options['above-header-submenu-border'] : true;
			$below_submenu_border = isset( $theme_options['below-header-submenu-border'] ) ? $theme_options['below-header-submenu-border'] : true;

			// Above Header.
			if ( $above_submenu_border ) {
				$theme_options['above-header-submenu-border']      = $border_enabled_values;
				$theme_options['above-header-submenu-item-border'] = $inside_border_enabled_values;
			} else {
				$theme_options['above-header-submenu-border']      = $border_disabled_values;
				$theme_options['above-header-submenu-item-border'] = $inside_border_disabled_values;
			}
			// Below Header.
			if ( $below_submenu_border ) {
				$theme_options['below-header-submenu-border']      = $border_enabled_values;
				$theme_options['below-header-submenu-item-border'] = $inside_border_enabled_values;
			} else {
				$theme_options['below-header-submenu-border']      = $border_disabled_values;
				$theme_options['below-header-submenu-item-border'] = $inside_border_disabled_values;
			}

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

User Contributed Notes

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