public function wpmuNewBlog( $new_site, $args ) {

		$this->blog_id = (int) $new_site->id;
		$this->user_id = (int) ( ! empty( $args['user_id'] ) ? $args['user_id'] : 0 );

		switch_to_blog( $this->blog_id );
		if ( ! $this->isBookSetup() ) {

			$this->wpmuActivate();
			array_walk(
				$this->opts, function ( $v, $k ) {
					if ( empty( $v ) ) {
						delete_option( $k );
					} else {
						update_option( $k, $v );
					}
				}
			);

			wp_cache_flush();
		}

		// Set current versions to skip redundant upgrade routines
		update_option( 'pressbooks_metadata_version', Metadata::VERSION );
		update_option( 'pressbooks_taxonomy_version', Taxonomy::VERSION );
		foreach ( ( new Modules\ThemeOptions\Admin() )->getTabs() as $slug => $theme_options_class ) {
			update_option( "pressbooks_theme_options_{$slug}_version", $theme_options_class::VERSION, false );
		}

		flush_rewrite_rules( false );

		/**
		 * @since 4.3.0
		 */
		do_action( 'pb_new_blog' );

		/**
		 * @deprecated 4.3.0 Use pb_new_blog instead.
		 */
		do_action( 'pressbooks_new_blog' );

		restore_current_blog();

		if ( is_user_logged_in() ) {
			( new \Pressbooks\Catalog() )->deleteCache();
			/**
			 * Determine whether or not to redirect the user to the new book's dashboard.
			 *
			 * @since 4.1.0
			 *
			 * @param bool $value Whether or not to redirect the user
			 */
			if ( apply_filters( 'pb_redirect_to_new_book', true ) ) {
				\Pressbooks\Redirect\location( get_admin_url( $this->blog_id ) );
			}
		}

	}
public function wpmuNewBlog( $new_site, $args ) {

		$this->blog_id = (int) $new_site->id;
		$this->user_id = (int) ( ! empty( $args['user_id'] ) ? $args['user_id'] : 0 );

		switch_to_blog( $this->blog_id );
		if ( ! $this->isBookSetup() ) {

			$this->wpmuActivate();
			array_walk(
				$this->opts, function ( $v, $k ) {
					if ( empty( $v ) ) {
						delete_option( $k );
					} else {
						update_option( $k, $v );
					}
				}
			);

			wp_cache_flush();
		}

		// Set current versions to skip redundant upgrade routines
		update_option( 'pressbooks_metadata_version', Metadata::VERSION );
		update_option( 'pressbooks_taxonomy_version', Taxonomy::VERSION );
		foreach ( ( new Modules\ThemeOptions\Admin() )->getTabs() as $slug => $theme_options_class ) {
			update_option( "pressbooks_theme_options_{$slug}_version", $theme_options_class::VERSION, false );
		}

		flush_rewrite_rules( false );

		/**
		 * @since 4.3.0
		 */
		do_action( 'pb_new_blog' );

		/**
		 * @deprecated 4.3.0 Use pb_new_blog instead.
		 */
		do_action( 'pressbooks_new_blog' );

		restore_current_blog();

		if ( is_user_logged_in() ) {
			( new \Pressbooks\Catalog() )->deleteCache();
			/**
			 * Determine whether or not to redirect the user to the new book's dashboard.
			 *
			 * @since 4.1.0
			 *
			 * @param bool $value Whether or not to redirect the user
			 */
			if ( apply_filters( 'pb_redirect_to_new_book', true ) ) {
				\Pressbooks\Redirect\location( get_admin_url( $this->blog_id ) );
			}
		}

	}
public function wpmuNewBlog ( $ new_site , $ args ) { $ this -> blog_id = ( int ) $ new_site -> id ; $ this -> user_id = ( int ) ( ! empty ( $ args [ 'user_id' ] ) ? $ args [ 'user_id' ] : 0 ) ; switch_to_blog ( $ this -> blog_id ) ; if ( ! $ this -> isBookSetup ( ) ) { $ this -> wpmuActivate ( ) ; array_walk ( $ this -> opts , function ( $ v , $ k ) { if ( empty ( $ v ) ) { delete_option ( $ k ) ; } else { update_option ( $ k , $ v ) ; } } ) ; wp_cache_flush ( ) ; } // Set current versions to skip redundant upgrade routines update_option ( 'pressbooks_metadata_version' , Metadata :: VERSION ) ; update_option ( 'pressbooks_taxonomy_version' , Taxonomy :: VERSION ) ; foreach ( ( new Modules \ ThemeOptions \ Admin ( ) ) -> getTabs ( ) as $ slug => $ theme_options_class ) { update_option ( "pressbooks_theme_options_{$slug}_version" , $ theme_options_class :: VERSION , false ) ; } flush_rewrite_rules ( false ) ; /**
		 * @since 4.3.0
		 */ do_action ( 'pb_new_blog' ) ; /**
		 * @deprecated 4.3.0 Use pb_new_blog instead.
		 */ do_action ( 'pressbooks_new_blog' ) ; restore_current_blog ( ) ; if ( is_user_logged_in ( ) ) { ( new \ Pressbooks \ Catalog ( ) ) -> deleteCache ( ) ; /**
			 * Determine whether or not to redirect the user to the new book's dashboard.
			 *
			 * @since 4.1.0
			 *
			 * @param bool $value Whether or not to redirect the user
			 */ if ( apply_filters ( 'pb_redirect_to_new_book' , true ) ) { \ Pressbooks \ Redirect \ location ( get_admin_url ( $ this -> blog_id ) ) ; } } }
Runs activation function and sets up default WP options for new blog,
a.k.a. when a registered user creates a new blog

@param \WP_Site $new_site New site object.
@param array $args Arguments for the initialization.

@see add_action( 'wp_initialize_site', ... )
Runs activation function and sets up default WP options for new blog a . k . a . when a registered user creates a new blog