PHP warning in ReadMoreIncludeManager
-
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
- The topic ‘PHP warning in ReadMoreIncludeManager’ is closed to new replies.