: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
public $type;// notification, warning etc.
public function setId($id)
public function setType($type)
public function getType()
public function setPriority($priority)
$this->priority = $priority;
public function getPriority()
public function setMessage($message)
$this->message = $message;
public function getMessage()
$type = $this->getType();
$color = '#01B9FF !important';
$color = '#28a745 !important';
$color = '#dc3545 !important';
$style = 'style="border-color: '.$color.';"';
$priority = $this->getPriority();
$message = $this->getMessage();
$btnHtml = $this->getCloseBtnById($id);
$content = '<div class="sgpb-single-notification-wrapper">
<div class="sgpb-single-notification" '.$style.'>
<span class="dashicons dashicons-no-alt sgpb-hide-notification-at-all" data-id="'.$id.'"></span>
<div class="sgpb-single-notification-close-btn">
public function getCloseBtnById($id)
$dismissedNotification = SGPBNotificationCenter::getAllDismissedNotifications();
if (isset($dismissedNotification[$id])) {
return '<button data-id="'.$id.'" class="button dismiss sgpb-activate-notification-js"><span class="dashicons dashicons-hidden"></span></button>';
return '<button data-id="'.$id.'" class="button dismiss sgpb-dismiss-notification-js"><span class="dashicons dashicons-visibility"></span></button>';