WordPress.org

Forums

WP VeriteCo Timeline
A fix for PHP 5.4 warnings empty value (2 posts)

  1. Annekee
    Member
    Posted 1 year ago #

    When saving a Timeline entry I got multiple: Warning: Creating default object from empty value in... etcetera, on a blank page. This was with a new install (v. 1.1.1) on a server new to me. After googling on the issue I managed to fix it in wp-veriteco-timeline.php. Find:

    if ($thumbnail_image && isset($thumbnail_image)) {
    	$this->asset->media = $img[0];
    	$this->asset->caption = $thumbnail_image->post_excerpt;
    }

    Replace this with:

    if ($thumbnail_image && isset($thumbnail_image)) {
    	if (!is_object($this->asset)) {
    		$this->asset = new stdClass;
    	}
    	$this->asset->media = $img[0];
    	$this->asset->caption = $thumbnail_image->post_excerpt;
    }

    I suppose you have to do the same with the next lines for video. And maybe more, but I have to find that out yet.

    https://wordpress.org/plugins/wp-veriteco-timeline/

  2. max_Q
    Member
    Posted 11 months ago #

    Thanks for working this out. I just posted on this error, too. I didn't get from your title that we were having the same problem. Anyway, I applied your fix and it worked. No muss, no fuss.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP VeriteCo Timeline
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic