Inventory_Presser_Plugin::delete_rewrite_rules_option( bool $network_wide )

delete_rewrite_rules_option


Description Description

Deletes the rewrite_rules option so the rewrite rules are generated on the next page load without ours. Called during deactivation.

See also See also


Top ↑

Parameters Parameters

$network_wide

(bool) (Required) True if this plugin is being Network Activated or Network Deactivated by the multisite admin


Top ↑

Return Return

(void)


Top ↑

Source Source

File: inventory-presser.php

	static function delete_rewrite_rules_option( $network_wide )
	{
		if( ! is_multisite() || ! $network_wide )
		{
			delete_option('rewrite_rules');
			return;
		}

		$sites = get_sites( array( 'network' => 1, 'limit' => 1000 ) );
		foreach( $sites as $site )
		{
			switch_to_blog( $site->blog_id );
			delete_option( 'rewrite_rules' );
			restore_current_blog();
		}
	}