public function update_theme( $theme_slug, $tag = 'master' ) {
		$theme = null;

		foreach ( (array) Singleton::get_instance( 'Theme', $this )->get_theme_configs() as $config_entry ) {
			if ( $config_entry->slug === $theme_slug ) {
				$theme = $config_entry;
				break;
			}
		}

		if ( ! $theme ) {
			throw new \UnexpectedValueException( 'Theme not found or not updatable with GitHub Updater: ' . $theme_slug );
		}

		$this->get_remote_repo_meta( $theme );
		$repo_api = Singleton::get_instance( 'API', $this )->get_repo_api( $theme->git, $theme );

		$update = [
			'theme'       => $theme->slug,
			'new_version' => null,
			'url'         => $theme->uri,
			'package'     => $repo_api->construct_download_link( $tag ),
		];

		add_filter(
			'site_transient_update_themes',
			function ( $current ) use ( $theme, $update ) {
				$current->response[ $theme->slug ] = $update;

				return $current;
			}
		);

		$upgrader = new \Theme_Upgrader( $this->upgrader_skin );
		$upgrader->upgrade( $theme->slug );
	}
public function update_theme( $theme_slug, $tag = 'master' ) {
		$theme = null;

		foreach ( (array) Singleton::get_instance( 'Theme', $this )->get_theme_configs() as $config_entry ) {
			if ( $config_entry->slug === $theme_slug ) {
				$theme = $config_entry;
				break;
			}
		}

		if ( ! $theme ) {
			throw new \UnexpectedValueException( 'Theme not found or not updatable with GitHub Updater: ' . $theme_slug );
		}

		$this->get_remote_repo_meta( $theme );
		$repo_api = Singleton::get_instance( 'API', $this )->get_repo_api( $theme->git, $theme );

		$update = [
			'theme'       => $theme->slug,
			'new_version' => null,
			'url'         => $theme->uri,
			'package'     => $repo_api->construct_download_link( $tag ),
		];

		add_filter(
			'site_transient_update_themes',
			function ( $current ) use ( $theme, $update ) {
				$current->response[ $theme->slug ] = $update;

				return $current;
			}
		);

		$upgrader = new \Theme_Upgrader( $this->upgrader_skin );
		$upgrader->upgrade( $theme->slug );
	}
public function update_theme ( $ theme_slug , $ tag = 'master' ) { $ theme = null ; foreach ( ( array ) Singleton :: get_instance ( 'Theme' , $ this ) -> get_theme_configs ( ) as $ config_entry ) { if ( $ config_entry -> slug === $ theme_slug ) { $ theme = $ config_entry ; break ; } } if ( ! $ theme ) { throw new \ UnexpectedValueException ( 'Theme not found or not updatable with GitHub Updater: ' . $ theme_slug ) ; } $ this -> get_remote_repo_meta ( $ theme ) ; $ repo_api = Singleton :: get_instance ( 'API' , $ this ) -> get_repo_api ( $ theme -> git , $ theme ) ; $ update = [ 'theme' => $ theme -> slug , 'new_version' => null , 'url' => $ theme -> uri , 'package' => $ repo_api -> construct_download_link ( $ tag ) , ] ; add_filter ( 'site_transient_update_themes' , function ( $ current ) use ( $ theme , $ update ) { $ current -> response [ $ theme -> slug ] = $ update ; return $ current ; } ) ; $ upgrader = new \ Theme_Upgrader ( $ this -> upgrader_skin ) ; $ upgrader -> upgrade ( $ theme -> slug ) ; }
Update a single theme.

@param string $theme_slug
@param string $tag

@throws \UnexpectedValueException Theme not found or not updatable.
Update a single theme .