Support » Plugin: Custom Twitter Feeds » /wp-content/plugins/custom-twitter-feeds/inc/CtfFeed.php on line 761

  • The plugin gives the following error when installed:
    /wp-content/plugins/custom-twitter-feeds/inc/CtfFeed.php on line 761

    The line it refers to uses count even when there is possibly no object in the array.

    A check to see if there is an object in the array should return 0 if no array I would suspect.

    We set up with a hashtag search – and the tag has not been used yet so it may fix itself when there is a post with that tag.

    I note this was a previous issue and was going to be resolved a year or so ago.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Craig at Smash Balloon

    (@craig-at-smash-balloon)

    Sorry about the issue!

    It looks like there was a separate issue relating to “count” that was fixed a year ago. We will fix this other one in the next update!

    In the meantime you can change that method to this:

        protected function numTweetsNeeded() {
    	    $tweet_count = 0;
    	    if ( isset( $this->tweet_set['statuses'] ) && is_array( $this->tweet_set['statuses'] ) ) {
    		    $tweet_count = count( $this->tweet_set['statuses'] );
    	    } elseif ( isset( $this->tweet_set ) && is_array( $this->tweet_set ) ) {
    		    $tweet_count = count( $this->tweet_set );
    	    }
    
            return $this->feed_options['num'] - $tweet_count;
        }

    This should fix the warning.

    – Craig

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.