WordPress.org

Ready to get started?Download WordPress

Forums

oAuth Twitter Feed for Developers
PHP error in StormTwitter.class.php (6 posts)

  1. AlecRust
    Member
    Posted 1 year ago #

    I've recently upgraded to WordPress 3.5.2 and am noticing the following error in the place of my Twitter feed using this plugin:

    Warning: array_slice() expects parameter 1 to be array, null given in /public_html/wp-content/plugins/oauth-twitter-feed-for-developers/StormTwitter.class.php on line 71

    Is this an issue with the plugin or my implementation (which uses your example)?

    http://wordpress.org/extend/plugins/oauth-twitter-feed-for-developers/

  2. redearthdesign
    Member
    Posted 1 year ago #

    Maybe that line can be wrapped in an if(is_array()?

  3. Naz
    Member
    Posted 1 year ago #

    Experiencing the same problem. It was fine a few weeks ago and suddenly (I didn't even change anything) it's been giving me this error and my feed won't show up.

    Does anyone have a fix for this? Thanks!

    Edit: Figured it out. As redearthdesign mentioned, use is_array(). I'm using the following code now and it works:

    if (is_array(getTweets(1)))
    {
    $tweets = getTweets(1);
    
    foreach ($tweets as $tweet)
    {
    // The rest of your code
    }
    }
  4. AlecRust
    Member
    Posted 1 year ago #

    Didn't work for me I'm afraid, same error persists. I too made no changes.

  5. Liam Gladdy
    Member
    Plugin Contributor

    Posted 1 year ago #

    Not sure why a WordPress upgrade will break this - but i'll get it fixed - we should be validating that is an array anyway in any example output!

  6. AlecRust
    Member
    Posted 1 year ago #

    That would be great, thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags