Created
October 31, 2019 15:04
-
-
Save kagg-design/7e0807d6e6308c338d12a8179f9c797b to your computer and use it in GitHub Desktop.
Fix performance issue in Jupiter X with WPML and Polylang. Replace code of \CustomizerMultilingual::get_custom_customizer_option
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function get_custom_customizer_option() { | |
static $theme_slug = null; | |
$current_language = self::get_language(); | |
if ( ! $theme_slug ) { | |
$theme_slug = get_option( 'template' ); | |
} | |
$option_prefix = str_replace( '-', '_', $theme_slug ); | |
$option_name = $option_prefix . self::get_option_key() . $current_language; | |
$value = wp_cache_get( $option_name, 'CustomizerMultilingual', false, $found ); | |
if ( $found ) { | |
return $value; | |
} | |
$value = get_option( $option_name, false ); | |
wp_cache_set( $option_name, $value, 'CustomizerMultilingual' ); | |
return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect, thank you very much!