This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

INVP::delete_all_inventory_on_blog()


Source

File: includes/class-invp.php

		foreach ( $sites as $site ) {
			switch_to_blog( $site->blog_id );
			$count = self::delete_all_inventory_on_blog();
			restore_current_blog();
			return $count;
		}
	}

	/**
	 * Deletes all posts in the vehicle post type.
	 *
	 * @return int
	 */
	private static function delete_all_inventory_on_blog() {
		$args          = array(
			'post_status'    => get_post_stati(),
			'post_type'      => self::POST_TYPE,
			'posts_per_page' => -1,
		);
		$posts         = get_posts( $args );
		$deleted_count = 0;
		$settings      = self::settings();

		if ( $posts ) {
			foreach ( $posts as $post ) {
				// delete the parent post or vehicle.