mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-05 12:32:23 +08:00
10 lines
493 B
Text
10 lines
493 B
Text
add_action( 'init', function() {
|
|
// Unschedule the WooCommerce related products transient cleanup event
|
|
$timestamp = wp_next_scheduled( 'wc_delete_related_product_transients_async' );
|
|
if ( $timestamp ) {
|
|
wp_unschedule_event( $timestamp, 'wc_delete_related_product_transients_async' );
|
|
}
|
|
|
|
// Prevent WooCommerce from scheduling it again
|
|
remove_action( 'woocommerce_scheduled_delete_related_product_transients', 'wc_delete_related_product_transients' );
|
|
}, 20 );
|