Skip to content

Commit 99d87bf

Browse files
committed
fix: remove typography var
1 parent 0801b8a commit 99d87bf

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • src/plugins/global-settings/preset-controls

src/plugins/global-settings/preset-controls/index.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,30 +91,29 @@ public function migrate_global_typography_font_size( $old_version, $new_version
9191
$typography_option = get_option( 'stackable_global_typography' );
9292

9393
if ( ! empty( $typography_option ) && isset( $typography_option[ 0 ] ) && is_array( $typography_option[ 0 ] ) ) {
94-
$typography = $typography_option[ 0 ];
9594
$updated = false;
9695

97-
foreach ( $typography as $key => $item ) {
96+
foreach ( $typography_option[ 0 ] as $key => $item ) {
9897
if ( ! is_array( $item ) ) {
9998
continue;
10099
}
101100

102101
foreach ( [ 'fontSize', 'tabletFontSize', 'mobileFontSize' ] as $size_key ) {
103102
if ( isset( $item[ $size_key ] ) && is_numeric( $item[ $size_key ] ) ) {
104-
$typography[ $key ][ $size_key ] = strval( $item[ $size_key ] );
103+
$typography_option[ 0 ][ $key ][ $size_key ] = strval( $item[ $size_key ] );
105104
$updated = true;
106105
}
107106
}
108107
}
109108

110109
if ( $updated ) {
111-
$typography_option[ 0 ] = $typography;
112110
update_option( 'stackable_global_typography', $typography_option );
113111
}
114112
}
115113
}
116114
}
117115

116+
118117
// Make the setting available in the editor
119118
public function add_setting( $settings ) {
120119
$settings['stackable_use_size_presets_by_default'] = get_option( 'stackable_use_size_presets_by_default' );

0 commit comments

Comments
 (0)