This seems to work, modifying the display_css_output()
in this way:
function display_css_output() {
$html = get_transient( 'my_custom_styles' );
if ( empty( $html ) ) {
$html = $this->generate_css_output();
global $wp_customize;
if ( ! isset( $wp_customize ) ) {
set_transient( 'my_custom_styles', $html, DAY_IN_SECONDS );
}
}
echo $html;
}
$short_life
no longer needed. Basically check to see if $wp_customize
is set, don’t bother setting transient then.