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

Bugfix - notice not shows

parent 0b52dd45
No related branches found
No related tags found
No related merge requests found
Pipeline #9407 passed with stages
in 1 minute and 46 seconds
...@@ -23,7 +23,6 @@ class Factory ...@@ -23,7 +23,6 @@ class Factory
*/ */
public static function notice($noticeContent = '', $noticeType = 'info', $isDismissible = false, $priority = 10) public static function notice($noticeContent = '', $noticeType = 'info', $isDismissible = false, $priority = 10)
{ {
error_log(14);
return new Notice($noticeContent, $noticeType, $isDismissible, $priority); return new Notice($noticeContent, $noticeType, $isDismissible, $priority);
} }
......
...@@ -75,7 +75,6 @@ class Notice ...@@ -75,7 +75,6 @@ class Notice
$priority = 10, $priority = 10,
$attributes = array() $attributes = array()
) { ) {
error_log(15);
$this->noticeContent = $noticeContent; $this->noticeContent = $noticeContent;
$this->noticeType = $noticeType; $this->noticeType = $noticeType;
$this->dismissible = $dismissible; $this->dismissible = $dismissible;
...@@ -157,9 +156,7 @@ error_log(15); ...@@ -157,9 +156,7 @@ error_log(15);
*/ */
protected function addAction() protected function addAction()
{ {
error_log(16);
if (!$this->actionAdded) { if (!$this->actionAdded) {
error_log(17);
add_action('admin_notices', [$this, 'showNotice'], $this->priority); add_action('admin_notices', [$this, 'showNotice'], $this->priority);
add_action( add_action(
'admin_footer', 'admin_footer',
...@@ -250,7 +247,6 @@ error_log(17); ...@@ -250,7 +247,6 @@ error_log(17);
*/ */
public function showNotice() public function showNotice()
{ {
error_log(51);
$this->removeAction(); $this->removeAction();
$noticeFormat = '<div %1$s>%2$s</div>'; $noticeFormat = '<div %1$s>%2$s</div>';
if ($this->addParagraphToContent()) { if ($this->addParagraphToContent()) {
......
...@@ -13,7 +13,6 @@ if (!function_exists('WPDeskNotice')) { ...@@ -13,7 +13,6 @@ if (!function_exists('WPDeskNotice')) {
*/ */
function WPDeskNotice($noticeContent, $noticeType = 'info', $dismissible = false, $priority = 10) function WPDeskNotice($noticeContent, $noticeType = 'info', $dismissible = false, $priority = 10)
{ {
error_log(12);
return \WPDesk\Notice\Factory::notice($noticeContent, $noticeType, $dismissible, $priority); return \WPDesk\Notice\Factory::notice($noticeContent, $noticeType, $dismissible, $priority);
} }
} }
...@@ -33,7 +32,6 @@ if (!function_exists('wpdesk_notice')) { ...@@ -33,7 +32,6 @@ if (!function_exists('wpdesk_notice')) {
*/ */
function wpdesk_notice($noticeContent, $noticeType = 'info', $dismissible = false, $priority = 10) function wpdesk_notice($noticeContent, $noticeType = 'info', $dismissible = false, $priority = 10)
{ {
error_log(11);
return WPDeskNotice($noticeContent, $noticeType, $dismissible, $priority); return WPDeskNotice($noticeContent, $noticeType, $dismissible, $priority);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment