Astra_Theme_Update::v_1_6_1()

Add backward compatibility for Heading tags previous default values.


Description

Set Inline Logo & Site Title as false if user had not changed its value. Change default value for blog archive blog title.


Return

(void)


Source

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

		public static function v_1_6_1() {
			$theme_options = get_option( 'astra-settings', array() );

			// If user was using a default value for h1, Set the default in the option.
			if ( ! isset( $theme_options['font-size-h1'] ) ) {
				$theme_options['font-size-h1'] = array(
					'desktop'      => '48',
					'tablet'       => '',
					'mobile'       => '',
					'desktop-unit' => 'px',
					'tablet-unit'  => 'px',
					'mobile-unit'  => 'px',
				);
			}
			// If user was using a default value for h2, Set the default in the option.
			if ( ! isset( $theme_options['font-size-h2'] ) ) {
				$theme_options['font-size-h2'] = array(
					'desktop'      => '42',
					'tablet'       => '',
					'mobile'       => '',
					'desktop-unit' => 'px',
					'tablet-unit'  => 'px',
					'mobile-unit'  => 'px',
				);
			}
			// If user was using a default value for h3, Set the default in the option.
			if ( ! isset( $theme_options['font-size-h3'] ) ) {
				$theme_options['font-size-h3'] = array(
					'desktop'      => '30',
					'tablet'       => '',
					'mobile'       => '',
					'desktop-unit' => 'px',
					'tablet-unit'  => 'px',
					'mobile-unit'  => 'px',
				);
			}

			// If user was using a default value for h3, Set the default in the option.
			if ( ! isset( $theme_options['font-size-page-title'] ) ) {
				$theme_options['font-size-page-title'] = array(
					'desktop'      => '30',
					'tablet'       => '',
					'mobile'       => '',
					'desktop-unit' => 'px',
					'tablet-unit'  => 'px',
					'mobile-unit'  => 'px',
				);
			}

			// If inline-logo option was unset previously, set to to false as new default is `true`.
			if ( ! isset( $theme_options['logo-title-inline'] ) ) {
				$theme_options['logo-title-inline'] = 0;
			}

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

User Contributed Notes

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