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

Bugfix - notice not shows

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