Tribe__Events__Event_Cleaner_Scheduler::add_hooks()

Schedules the hooks to delete and move old events to trash These hooks will be executed daily.

Contents


Source

File: src/Tribe/Event_Cleaner_Scheduler.php

	public function add_hooks() {
		if ( ! wp_next_scheduled( self::$trash_cron_hook ) && $this->trash_new_date != null ) {
			wp_schedule_event( time(), 'daily', self::$trash_cron_hook );
		}

		if ( ! wp_next_scheduled( self::$del_cron_hook ) && $this->del_new_date != null ) {
			wp_schedule_event( time(), 'daily', self::$del_cron_hook );
		}

		if ( null != $this->trash_new_date ) {
			add_action( self::$trash_cron_hook, array( $this, 'move_old_events_to_trash' ), 10, 0 );
		}

		if ( null != $this->del_new_date ) {
			add_action( self::$del_cron_hook, array( $this, 'permanently_delete_old_events' ), 10, 0 );
		}

		add_action( 'tribe_events_blog_deactivate', array( $this, 'trash_clear_scheduled_task' ) );
		add_action( 'tribe_events_blog_deactivate', array( $this, 'delete_clear_scheduled_task' ) );
	}

Top ↑

Changelog

Changelog
Version Description
4.6.13 Introduced.