Inventory_Presser_Plugin::delete_rewrite_rules_option( bool $network_wide )

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


Description Description

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

	public 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();
		}
	}