public function delete( $args, $assoc_args ) {
		if ( ! is_multisite() ) {
			WP_CLI::error( 'This is not a multisite installation.' );
		}

		if ( isset( $assoc_args['slug'] ) ) {
			$blog = get_blog_details( trim( $assoc_args['slug'], '/' ) );
		} else {
			if ( empty( $args ) ) {
				WP_CLI::error( 'Need to specify a blog id.' );
			}

			$blog_id = $args[0];

			if ( is_main_site( $blog_id ) ) {
				WP_CLI::error( 'You cannot delete the root site.' );
			}

			$blog = get_blog_details( $blog_id );
		}

		if ( ! $blog ) {
			WP_CLI::error( 'Site not found.' );
		}

		$site_url = trailingslashit( $blog->siteurl );

		WP_CLI::confirm( "Are you sure you want to delete the '{$site_url}' site?", $assoc_args );

		wpmu_delete_blog( $blog->blog_id, ! Utils\get_flag_value( $assoc_args, 'keep-tables' ) );

		WP_CLI::success( "The site at '{$site_url}' was deleted." );
	}
public function delete( $args, $assoc_args ) {
		if ( ! is_multisite() ) {
			WP_CLI::error( 'This is not a multisite installation.' );
		}

		if ( isset( $assoc_args['slug'] ) ) {
			$blog = get_blog_details( trim( $assoc_args['slug'], '/' ) );
		} else {
			if ( empty( $args ) ) {
				WP_CLI::error( 'Need to specify a blog id.' );
			}

			$blog_id = $args[0];

			if ( is_main_site( $blog_id ) ) {
				WP_CLI::error( 'You cannot delete the root site.' );
			}

			$blog = get_blog_details( $blog_id );
		}

		if ( ! $blog ) {
			WP_CLI::error( 'Site not found.' );
		}

		$site_url = trailingslashit( $blog->siteurl );

		WP_CLI::confirm( "Are you sure you want to delete the '{$site_url}' site?", $assoc_args );

		wpmu_delete_blog( $blog->blog_id, ! Utils\get_flag_value( $assoc_args, 'keep-tables' ) );

		WP_CLI::success( "The site at '{$site_url}' was deleted." );
	}
public function delete ( $ args , $ assoc_args ) { if ( ! is_multisite ( ) ) { WP_CLI :: error ( 'This is not a multisite installation.' ) ; } if ( isset ( $ assoc_args [ 'slug' ] ) ) { $ blog = get_blog_details ( trim ( $ assoc_args [ 'slug' ] , '/' ) ) ; } else { if ( empty ( $ args ) ) { WP_CLI :: error ( 'Need to specify a blog id.' ) ; } $ blog_id = $ args [ 0 ] ; if ( is_main_site ( $ blog_id ) ) { WP_CLI :: error ( 'You cannot delete the root site.' ) ; } $ blog = get_blog_details ( $ blog_id ) ; } if ( ! $ blog ) { WP_CLI :: error ( 'Site not found.' ) ; } $ site_url = trailingslashit ( $ blog -> siteurl ) ; WP_CLI :: confirm ( "Are you sure you want to delete the '{$site_url}' site?" , $ assoc_args ) ; wpmu_delete_blog ( $ blog -> blog_id , ! Utils \ get_flag_value ( $ assoc_args , 'keep-tables' ) ) ; WP_CLI :: success ( "The site at '{$site_url}' was deleted." ) ; }
Deletes a site in a multisite installation.

## OPTIONS

[<site-id>]
: The id of the site to delete. If not provided, you must set the --slug parameter.

[--slug=<slug>]
: Path of the blog to be deleted. Subdomain on subdomain installs, directory on subdirectory installs.

[--yes]
: Answer yes to the confirmation message.

[--keep-tables]
: Delete the blog from the list, but don't drop it's tables.

## EXAMPLES

$ wp site delete 123
Are you sure you want to delete the http://www.example.com/example site? [y/n] y
Success: The site at 'http://www.example.com/example' was deleted.
Deletes a site in a multisite installation .