title: Display Google sheet table in wordpress using API
body: <p>I am trying to display a table from Google sheets in Wordpress using API call but my code does not show anything.
  The API call with the URL works in a browser.</p>
  <p>Here is my code in woocommerce-single.php</p>
  <pre><code>add_action('woocommerce_after_single_product_summary', 'display_google_sheet_table', 9);
  function display_google_sheet_table() { 
      $API = 'MY-API-KEY'; 
      $google_spreadsheet_ID = 'MY-SPREADSHEET-ID'; 
      $api_key = esc_attr( $API); 
      $get_cell = new WP_Http(); 
      $cell_url = &quot;https://sheets.googleapis.com/v4/spreadsheets/$google_spreadsheet_ID/values/A2:D9999?&amp;key=$api_key&quot;; 
      $cell_response = $get_cell -&gt; get( $cell_url); 
      $body = wp_remote_retrieve_body($response);
      $table_data = json_decode($body);
      $html = array();
      if(!empty($table_data)){
       $html[] = '&lt;table&gt;';
       foreach($table_data as $rows){
         $html[] = '&lt;tr&gt;';
    foreach($row as $column){
        $html[] = '&lt;td&gt;'. $column . '&lt;/td&gt;';
      }
      $html[] = '&lt;/tr&gt;';
    }
    $html ='&lt;/table&gt;';
  }
  $html = implode(&quot;\n&quot;, $html);
  echo $html; } 
  </code></pre>