astra_apply_layout_migration( mixed $old_layout, mixed $new_layout, mixed $content_style, mixed $sidebar_style, array $theme_options )
Handle migration from old to new layouts.
Description
Migration cases for old users, old layouts -> new layouts.
Parameters
- $old_layout
-
(mixed) (Required) old_layout.
- $new_layout
-
(mixed) (Required) new_layout.
- $content_style
-
(mixed) (Required) content_style.
- $sidebar_style
-
(mixed) (Required) sidebar_style.
- $theme_options
-
(array) (Required) theme_options.
Return
(array) $theme_options The updated theme options.
Source
File: inc/theme-update/astra-update-functions.php
function astra_apply_layout_migration( $old_layout, $new_layout, $content_style, $sidebar_style, $theme_options ) {
switch ( astra_get_option( $old_layout ) ) {
case 'boxed-container':
$theme_options[ $new_layout ] = 'normal-width-container';
$theme_options[ $content_style ] = 'boxed';
$theme_options[ $sidebar_style ] = 'boxed';
break;
case 'content-boxed-container':
$theme_options[ $new_layout ] = 'normal-width-container';
$theme_options[ $content_style ] = 'boxed';
$theme_options[ $sidebar_style ] = 'unboxed';
break;
case 'plain-container':
$theme_options[ $new_layout ] = 'normal-width-container';
$theme_options[ $content_style ] = 'unboxed';
$theme_options[ $sidebar_style ] = 'unboxed';
break;
case 'page-builder':
$theme_options[ $new_layout ] = 'full-width-container';
$theme_options[ $content_style ] = 'unboxed';
$theme_options[ $sidebar_style ] = 'unboxed';
break;
case 'narrow-container':
$theme_options[ $new_layout ] = 'narrow-width-container';
$theme_options[ $content_style ] = 'unboxed';
$theme_options[ $sidebar_style ] = 'unboxed';
break;
default:
$theme_options[ $new_layout ] = 'default';
$theme_options[ $content_style ] = 'default';
$theme_options[ $sidebar_style ] = 'default';
break;
}
return $theme_options;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 4.2.0 | Introduced. |