Skip to content
Snippets Groups Projects
Commit 696f8117 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

feature(js): support for gutenberg

parent 5e1be4a3
No related branches found
No related tags found
1 merge request!20Feature/gutenberg
Pipeline #11121 failed
This commit is part of merge request !20. Comments created here will be created in the context of that merge request.
...@@ -211,7 +211,7 @@ class Notice ...@@ -211,7 +211,7 @@ class Notice
public function addGutenbergScript() public function addGutenbergScript()
{ {
if ($this->isBlockEditor()) { if ($this->isBlockEditor()) {
include_once 'views/admin-head-js-gutenberg.php'; include_once __DIR__ . '/views/admin-head-js-gutenberg.php';
} }
} }
...@@ -233,21 +233,23 @@ class Notice ...@@ -233,21 +233,23 @@ class Notice
*/ */
protected function getNoticeClass() protected function getNoticeClass()
{ {
$notice_classes = ['notice'];
if ('updated' === $this->noticeType) { if ('updated' === $this->noticeType) {
$notice_class = 'notice ' . $this->noticeType; $notice_classes[] = $this->noticeType;
} else { } else {
$notice_class = 'notice notice-' . $this->noticeType; $notice_classes[] = 'notice-' . $this->noticeType;
} }
if ($this->dismissible) { if ($this->dismissible) {
$notice_class .= ' is-dismissible'; $notice_classes[] = 'is-dismissible';
} }
if (isset($this->attributes['class'])) { if (isset($this->attributes['class'])) {
$notice_class .= ' ' . $this->attributes['class']; $notice_classes[] = $this->attributes['class'];
} }
if ($this->showInGutenberg) { if ($this->showInGutenberg) {
$notice_class .= ' wpdesk-notice-gutenberg'; $notice_classes[] = 'wpdesk-notice-gutenberg';
} }
return $notice_class;
return implode( ' ', $notice_classes );
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment