WordPress at Your Fingertips
function is not described

ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup() public WC 1.0

Schedules the WP Post comment table cleanup to run in 6 months if it's not already scheduled. Attached to the migration complete hook 'action_scheduler/migration_complete'.

{} It's a method of the class: ActionScheduler_WPCommentCleaner{}

No Hooks.

Return

null. Nothing.

Usage

$result = ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup();

Code of ActionScheduler_WPCommentCleaner::maybe_schedule_cleanup() WC 6.1.0

public static function maybe_schedule_cleanup() {
	if ( (bool) get_comments( array( 'type' => ActionScheduler_wpCommentLogger::TYPE, 'number' => 1, 'fields' => 'ids' ) ) ) {
		update_option( self::$has_logs_option_key, 'yes' );

		if ( ! as_next_scheduled_action( self::$cleanup_hook ) ) {
			as_schedule_single_action( gmdate( 'U' ) + ( 6 * MONTH_IN_SECONDS ), self::$cleanup_hook );
		}
	}
}