title: How to solve illegal offset error in wordpress PHP?
body: <p>Our hosting provider has recently updated their PHP version and we're now facing the following issue.</p>
  
  <blockquote>
    <p>Warning: Illegal string offset 'items' in /home/unite-helpers.php on line 778</p>
  </blockquote>
  
  <p>The code this relates to is as follows, which is already in single quotes:</p>
  
  <pre><code>if ( ! function_exists( 'ut_recognized_google_fonts' ) ) {
  
  function ut_recognized_google_fonts( $field_id = '' ) {
  
      if ( false === get_transient( 'ut_recognized_google_fonts' ) ) {
  
          $google_fonts = json_decode( wp_remote_retrieve_body( wp_remote_get( FW_WEB_ROOT . '/core/admin/assets/fonts/google_fonts.json' ) ), true );        
  
          set_transient( 'ut_recognized_google_fonts' , $google_fonts, 60 * 60 * 24 );
  
      } else {
  
          $google_fonts = get_transient( 'ut_recognized_google_fonts' );       
  
      }
  
      return apply_filters( 'ut_recognized_google_fonts' , $google_fonts['items'] , $field_id );
  
  }
  
  }
  </code></pre>
  
  <p>If anyone can shed some light on how to resolve this it would be hugely appreciated.</p>