Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

PHP warning in ReadMoreIncludeManager

$
0
0

Replies: 0

I got this warning on my website:

Warning: Undefined array key “btn-hover-bg-color” in /www/wp-content/plugins/read-more/classes/ReadMoreIncludeManager.php on line 137

I got rid of it by changing this code:

public function includeCustomStyle() {

		$id = $this->getId();
		$savedData = $this->getData();
		$type = $savedData['type'];

		if($type == 'button') {
			$hoverBgColor = $savedData['btn-hover-bg-color'];
			$hoverTextColor = $savedData['btn-hover-text-color'];

			if(!empty($savedData['hover-effect'])) {
				echo "<style>
					.yrm-toggle-expand-$id:hover {
						background-color: $hoverBgColor !important;
						color: $hoverTextColor !important;
					}
				</style>";
			}
		}
	}

Into this code:

public function includeCustomStyle() {

		$id = $this->getId();
		$savedData = $this->getData();
		$type = $savedData['type'];

		if($type == 'button') {

			if(!empty($savedData['hover-effect'])) {
				$hoverBgColor = $savedData['btn-hover-bg-color'];
				$hoverTextColor = $savedData['btn-hover-text-color'];
				echo "<style>
					.yrm-toggle-expand-$id:hover {
						background-color: $hoverBgColor !important;
						color: $hoverTextColor !important;
					}
				</style>";
			}
		}
	}

I don’t expect this is the proper solution, but it worked for me!

Kind regards
Robert


Viewing all articles
Browse latest Browse all 59525

Trending Articles