Skip to content

Instantly share code, notes, and snippets.

@bwmarkle
Created August 31, 2022 18:47
Show Gist options
  • Save bwmarkle/c3ad9d5e7e2667f5c66c4ac564c7b050 to your computer and use it in GitHub Desktop.
Save bwmarkle/c3ad9d5e7e2667f5c66c4ac564c7b050 to your computer and use it in GitHub Desktop.
add_filter( 'pre_clear_scheduled_hook', function( $null, $hook, $args, $wp_error ) {
$core = apply_filters( 'boldgrid_backup_get_core', false );
$logger = new Boldgrid_Backup_Admin_Log( $core );
$logger->init( 'pre_clear_scheduled_hook.log' );
// We want to include the trace to see what is clearing the schedule.
$e = new \Exception();
$e = explode( "\n", $e->getTraceAsString() );
$logger->add( print_r( array(
'$hook' => $hook,
'$args' => $args,
'$wp_error' => $wp_error,
'$e' => $e,
), 1 ) );
return null;
}, 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment