Skip to content

Instantly share code, notes, and snippets.

@premanshup
Created January 24, 2020 09:06
Show Gist options
  • Select an option

  • Save premanshup/ef7484ab0b4fb467a89171dec2004a51 to your computer and use it in GitHub Desktop.

Select an option

Save premanshup/ef7484ab0b4fb467a89171dec2004a51 to your computer and use it in GitHub Desktop.
Check typography addon active or not and load options according.
$customizer_data = get_option( 'astra-settings', array() );
$is_typo_addon_active = is_callable( 'Astra_Ext_Extension::is_active' ) ? Astra_Ext_Extension::is_active( 'typography' ) : false;
for ( $i = 1; $i < 7; $i++ ) {
if ( ( ( $i > 3 ) && ( true === $is_typo_addon_active ) ) || ( $i < 4 ) ) {
if ( isset( $theme_settings[ 'font-size-h' . $i ] ) && '' !== $theme_settings[ 'font-size-h' . $i ] ) {
$elementor_page_settings[ 'astra_sites_heading_' . $i . '_typography' ] = 'custom';
$elementor_page_settings[ 'astra_sites_heading_' . $i . '_font_size' ] = array(
'unit' => $theme_settings[ 'font-size-h' . $i ]['desktop-unit'],
'size' => (int) $theme_settings[ 'font-size-h' . $i ]['desktop'],
);
if ( '' !== $theme_settings[ 'font-size-h' . $i ]['tablet'] ) {
$elementor_page_settings[ 'astra_sites_heading_' . $i . '_font_size_tablet' ] = array(
'unit' => $theme_settings[ 'font-size-h' . $i ]['tablet-unit'],
'size' => (int) $theme_settings[ 'font-size-h' . $i ]['tablet'],
);
}
if ( '' !== $theme_settings[ 'font-size-h' . $i ]['mobile'] ) {
$elementor_page_settings[ 'astra_sites_heading_' . $i . '_font_size_mobile' ] = array(
'unit' => $theme_settings[ 'font-size-h' . $i ]['mobile-unit'],
'size' => (int) $theme_settings[ 'font-size-h' . $i ]['mobile'],
);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment