Tribe__Events__Dates__Known_Range::maybe_update_known_range( $post_id )

Intended to run when the save_post_tribe_events action is fired.

At this point we know an event is being updated or created and, if the post is going to be visible, we can set up a further action to handle updating our record of the populated date range once the post meta containing the start and end date for the post has saved.


Source

File: src/Tribe/Dates/Known_Range.php

	public function maybe_update_known_range( $post_id ) {
		// If the event isn't going to be visible (perhaps it's been trashed) rebuild dates and bail
		if ( ! in_array( get_post_status( $post_id ), array( 'publish', 'private', 'protected' ) ) ) {
			$this->rebuild_known_range();

			return;
		}

		add_action( 'tribe_events_update_meta', array( $this, 'update_known_range' ) );
	}