Inventory_Presser_Allow_Inventory_As_Home_Page::create_pages()

create_pages


Description

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


Return

(void)


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'   => apply_filters( 'invp_query_limit', 1000, __METHOD__ ),
			)
		);
		foreach ( $sites as $site ) {
			switch_to_blog( $site->blog_id );
			self::create_page();
			restore_current_blog();
		}
	}