src/Modules/Recommendation.php
private function get_themes( $themes_list, $preferences ) {
		$list = array();
		foreach ( $themes_list as $slug => $nicename ) {
			$theme = $this->call_theme_api( $slug );
			if ( ! $theme ) {
				continue;
			}

			$url = add_query_arg(
				array(
					'theme' => $theme->slug,
				),
				network_admin_url( 'theme-install.php' )
			);

			$name = empty( $nicename ) ? $theme->name : $nicename;

			$theme->custom_url  = $url;
			$theme->custom_name = $name;

			$list[] = $theme;
		}

		return $list;
	}
private function get_themes( $themes_list, $preferences ) {
		$list = array();
		foreach ( $themes_list as $slug => $nicename ) {
			$theme = $this->call_theme_api( $slug );
			if ( ! $theme ) {
				continue;
			}

			$url = add_query_arg(
				array(
					'theme' => $theme->slug,
				),
				network_admin_url( 'theme-install.php' )
			);

			$name = empty( $nicename ) ? $theme->name : $nicename;

			$theme->custom_url  = $url;
			$theme->custom_name = $name;

			$list[] = $theme;
		}

		return $list;
	}
private function get_themes ( $ themes_list , $ preferences ) { $ list = array ( ) ; foreach ( $ themes_list as $ slug => $ nicename ) { $ theme = $ this -> call_theme_api ( $ slug ) ; if ( ! $ theme ) { continue ; } $ url = add_query_arg ( array ( 'theme' => $ theme -> slug , ) , network_admin_url ( 'theme-install.php' ) ) ; $ name = empty ( $ nicename ) ? $ theme -> name : $ nicename ; $ theme -> custom_url = $ url ; $ theme -> custom_name = $ name ; $ list [ ] = $ theme ; } return $ list ; }
Collect all the information for the themes list.

@param array $themes_list - list of useful themes (in slug => nicename format).
@param array $preferences - list of preferences.

@return array
Collect all the information for the themes list .