Created
August 27, 2020 00:55
-
-
Save jessLundie/24f79fad26cbd6eb181034ce805b4ff1 to your computer and use it in GitHub Desktop.
Action Scheduler - single action - clean up WP Comments orphaned log entries
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 | |
function reth_run_cleanup() { | |
if ( ! as_next_scheduled_action( 'action_scheduler/cleanup_wp_comment_logs' ) ) { | |
as_schedule_single_action( gmdate( 'U' ) + ( 60 * MINUTE_IN_SECONDS ), 'action_scheduler/cleanup_wp_comment_logs' ); | |
} | |
} | |
add_action( 'init', 'reth_run_cleanup' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment