original_string: public static function fetch_google_fonts( $api_key = null ) {
  		$raw_fonts = static::request_google_fonts( $api_key );
  
  		// Invalid API key or something else.
  		if ( ! is_array( $raw_fonts ) || ! isset( $raw_fonts['items'] ) ) {
  			return [];
  		}
  
  		$fonts = [];
  
  		foreach ( $raw_fonts['items'] as $item ) {
  			if ( ! isset( $item['kind'] ) || 'webfonts#webfont' !== $item['kind'] ) {
  				continue;
  			}
  
  			$fonts[] = Arr::only( $item, [ 'family', 'category', 'variants', 'subset' ] );
  		}
  
  		static::flush_transients();
  		static::set_transients( $fonts );
  
  		return $fonts;
  	}
code: public static function fetch_google_fonts( $api_key = null ) {
  		$raw_fonts = static::request_google_fonts( $api_key );
  
  		// Invalid API key or something else.
  		if ( ! is_array( $raw_fonts ) || ! isset( $raw_fonts['items'] ) ) {
  			return [];
  		}
  
  		$fonts = [];
  
  		foreach ( $raw_fonts['items'] as $item ) {
  			if ( ! isset( $item['kind'] ) || 'webfonts#webfont' !== $item['kind'] ) {
  				continue;
  			}
  
  			$fonts[] = Arr::only( $item, [ 'family', 'category', 'variants', 'subset' ] );
  		}
  
  		static::flush_transients();
  		static::set_transients( $fonts );
  
  		return $fonts;
  	}
code_tokens: public static function fetch_google_fonts ( $ api_key = null ) { $ raw_fonts = static :: request_google_fonts ( $ api_key ) ; // Invalid API key or something else. if ( ! is_array ( $ raw_fonts ) || ! isset ( $ raw_fonts [ 'items' ] ) ) { return [ ] ; } $ fonts = [ ] ; foreach ( $ raw_fonts [ 'items' ] as $ item ) { if ( ! isset ( $ item [ 'kind' ] ) || 'webfonts#webfont' !== $ item [ 'kind' ] ) { continue ; } $ fonts [ ] = Arr :: only ( $ item , [ 'family' , 'category' , 'variants' , 'subset' ] ) ; } static :: flush_transients ( ) ; static :: set_transients ( $ fonts ) ; return $ fonts ; }
docstring: Get list of fonts from Google Fonts.
  
  @param  string $api_key The Google Fonts API key.
  @return array|false
docstring_tokens: Get list of fonts from Google Fonts .