0

Twitter プラグインで次のエラーが発生し続けます。

致命的なエラー: タイプ stdClass のオブジェクトを C:.... の配列として使用できません (72 行目)

時々しか表示されませんが、私のTwitterカウンターはかなりの時間変化しません. 助けてください。以下のコードは、行が中央にあることを示しています。

<?php if(get_option('pyre_twitter_id')): ?>
<div class="social-box">
  <a href='http://twitter.com/<?php echo get_option('pyre_twitter_id'); ?>'>
  <img src="<?php echo get_template_directory_uri(); ?>/images/twitter.png" alt="Follow us on Twitter" width="48" height="48" /></a>
  <?php
  $interval = 3600;

  if($_SERVER['REQUEST_TIME'] > get_option('pyre_twitter_cache_time')) {
    @$api = wp_remote_get('http://twitter.com/statuses/user_timeline/' . get_option('pyre_twitter_id') . '.json');
    @$json = json_decode($api['body']);

    if(@$api['headers']['x-ratelimit-remaining'] >= 1) {
      update_option('pyre_twitter_cache_time', $_SERVER['REQUEST_TIME'] + $interval);
      update_option('pyre_twitter_followers', $json[0]->user->followers_count);
    }
  }
  ?>
  <div class="social-box-text">
    <span class="social-arrow"></span>
    <span class="social-box-descrip"><?php _e('Follow us on Twitter', 'pyre'); ?></span>
    <span class="social-box-count"><?php echo get_option('pyre_twitter_followers'); ?> <?php _e('Followers', 'pyre'); ?></span>
  </div>
</div>
<?php endif; ?>
4

2 に答える 2