Inventory_Presser_Allow_Inventory_As_Home_Page::create_pages()

create_pages


Description Description

Are we on multi-site? If so, we need to create a page on every blog in the multisite network


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-allow-inventory-as-home-page.php

	static function create_pages()
	{
		if( ! is_multisite() )
		{
			self::create_page();
			return;
		}

		//We are on multisite, create a page for every site on the network
		$sites = get_sites( array( 'network' => 1, 'limit' => 1000 ) );
		foreach( $sites as $site )
		{
			switch_to_blog( $site->blog_id );
			self::create_page();
			restore_current_blog();
		}
	}