Skip to content

Instantly share code, notes, and snippets.

@WProbot
Last active April 15, 2022 12:49
Show Gist options
  • Select an option

  • Save WProbot/8b216207de8ba027419ee32f12a06028 to your computer and use it in GitHub Desktop.

Select an option

Save WProbot/8b216207de8ba027419ee32f12a06028 to your computer and use it in GitHub Desktop.
<?php
add_action( 'setted_transient', 'fix_wc_product_loop_transient', 50, 3 );
function fix_wc_product_loop_transient( $transient, $value, $expiration ){
$pos = strpos( $transient, 'wc_product_loop_' );
if ( $pos !== false && $expiration == 2592000 ) {
set_transient( $transient, $value, DAY_IN_SECONDS );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment