Inventory_Presser_Allow_Inventory_As_Home_Page::delete_pages()

delete_pages

Description Description

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


Top ↑

Return Return

(void)


Top ↑

Source Source

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

	public static function delete_pages() {
		if ( ! is_multisite() ) {
			wp_delete_post( self::find_page_id(), true );
			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 );
			wp_delete_post( self::find_page_id(), true );
			restore_current_blog();
		}
	}