Astra_Addon_Update::v_1_3_0()
Update options of older version than 1.3.0.
Description
Background options
Source
File: classes/class-astra-addon-update.php
public static function v_1_3_0() { $astra_options = get_option( 'astra-settings', array() ); $astra_options['header-bg-obj'] = array( 'background-color' => isset( $astra_options['header-bg-color'] ) ? $astra_options['header-bg-color'] : '', ); $astra_options['content-bg-obj'] = array( 'background-color' => isset( $astra_options['content-bg-color'] ) ? $astra_options['content-bg-color'] : '#ffffff', ); $astra_options['above-header-bg-obj'] = array( 'background-color' => isset( $astra_options['above-header-bg-color'] ) ? $astra_options['above-header-bg-color'] : '', ); $astra_options['below-header-bg-obj'] = array( 'background-color' => isset( $astra_options['below-header-bg-color'] ) ? $astra_options['below-header-bg-color'] : '', ); $astra_options['footer-adv-bg-obj'] = array( 'background-color' => isset( $astra_options['footer-adv-bg-color'] ) ? $astra_options['footer-adv-bg-color'] : '', 'background-image' => isset( $astra_options['footer-adv-bg-img'] ) ? $astra_options['footer-adv-bg-img'] : '', 'background-repeat' => isset( $astra_options['footer-adv-bg-repeat'] ) ? $astra_options['footer-adv-bg-repeat'] : 'no-repeat', 'background-position' => isset( $astra_options['footer-adv-bg-pos'] ) ? $astra_options['footer-adv-bg-pos'] : 'center center', 'background-size' => isset( $astra_options['footer-adv-bg-size'] ) ? $astra_options['footer-adv-bg-size'] : 'cover', 'background-attachment' => isset( $astra_options['footer-adv-bg-attac'] ) ? $astra_options['footer-adv-bg-attac'] : 'scroll', ); $astra_options['footer-bg-obj'] = array( 'background-color' => isset( $astra_options['footer-bg-color'] ) ? $astra_options['footer-bg-color'] : '', 'background-image' => isset( $astra_options['footer-bg-img'] ) ? $astra_options['footer-bg-img'] : '', 'background-repeat' => isset( $astra_options['footer-bg-rep'] ) ? $astra_options['footer-bg-rep'] : 'repeat', 'background-position' => isset( $astra_options['footer-bg-pos'] ) ? $astra_options['footer-bg-pos'] : 'center center', 'background-size' => isset( $astra_options['footer-bg-size'] ) ? $astra_options['footer-bg-size'] : 'auto', 'background-attachment' => isset( $astra_options['footer-bg-atch'] ) ? $astra_options['footer-bg-atch'] : 'scroll', ); // Site layout background image and color. $site_layout = isset( $astra_options['site-layout'] ) ? $astra_options['site-layout'] : ''; switch ( $site_layout ) { case 'ast-box-layout': $astra_options['site-layout-outside-bg-obj'] = array( 'background-color' => isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : '', 'background-image' => isset( $astra_options['site-layout-box-bg-img'] ) ? $astra_options['site-layout-box-bg-img'] : '', 'background-repeat' => isset( $astra_options['site-layout-box-bg-rep'] ) ? $astra_options['site-layout-box-bg-rep'] : 'no-repeat', 'background-position' => isset( $astra_options['site-layout-box-bg-pos'] ) ? $astra_options['site-layout-box-bg-pos'] : 'center center', 'background-size' => isset( $astra_options['site-layout-box-bg-size'] ) ? $astra_options['site-layout-box-bg-size'] : 'cover', 'background-attachment' => isset( $astra_options['site-layout-box-bg-atch'] ) ? $astra_options['site-layout-box-bg-atch'] : 'scroll', ); break; case 'ast-padded-layout': $bg_color = isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : ''; $bg_image = isset( $astra_options['site-layout-padded-bg-img'] ) ? $astra_options['site-layout-padded-bg-img'] : ''; $astra_options['site-layout-outside-bg-obj'] = array( 'background-color' => empty( $bg_image ) ? $bg_color : '', 'background-image' => $bg_image, 'background-repeat' => isset( $astra_options['site-layout-padded-bg-rep'] ) ? $astra_options['site-layout-padded-bg-rep'] : 'no-repeat', 'background-position' => isset( $astra_options['site-layout-padded-bg-pos'] ) ? $astra_options['site-layout-padded-bg-pos'] : 'center center', 'background-size' => isset( $astra_options['site-layout-padded-bg-size'] ) ? $astra_options['site-layout-padded-bg-size'] : 'cover', 'background-attachment' => '', ); break; case 'ast-full-width-layout': case 'ast-fluid-width-layout': default: $astra_options['site-layout-outside-bg-obj'] = array( 'background-color' => isset( $astra_options['site-layout-outside-bg-color'] ) ? $astra_options['site-layout-outside-bg-color'] : '', ); break; } update_option( 'astra-settings', $astra_options ); }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
1.3.0 | Introduced. |