Tribe__Events__Rewrite::maybe_delayed_flush_rewrite_rules()

When dealing with flush of rewrite rules we cannot do it from the activation process due to not all classes being loaded just yet. We flag a transient without expiration on activation so that on the next page load we flush the permalinks for the website.

See also


Top ↑

Return

(void)


Top ↑

Source

File: src/Tribe/Rewrite.php

	public function maybe_delayed_flush_rewrite_rules() {
		$should_flush_rewrite_rules = tribe_is_truthy( get_transient( static::KEY_DELAYED_FLUSH_REWRITE_RULES ) );

		if ( ! $should_flush_rewrite_rules ) {
			return;
		}

		delete_transient( static::KEY_DELAYED_FLUSH_REWRITE_RULES );

		flush_rewrite_rules();
	}

Top ↑

Changelog

Changelog
Version Description
5.0.0.1 Introduced.