first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
jQuery( document ).ready(function() {
jQuery('.wpdesk-notice-gutenberg').each(function( index ) {
var classList = jQuery(this).attr('class').split(/\s+/);
var type = '';
jQuery.each(classList, function(index, item) {
if (item.startsWith('notice-')) {
type = item.replace('notice-','');
}
});
content = this.innerText;
actions = [];
jQuery.each(jQuery(this).find('a'), function(index, item) {
text = item.innerText;
actions.push({
url: item.href,
label: text.charAt(0).toUpperCase() + text.slice(1),
});
});
isDismiss = jQuery(this).hasClass('is-dismissible');
window.wp.data.dispatch( 'core/notices' ).createNotice(
type,
content,
{
isDismissible: isDismiss,
actions: actions
}
);
});
} );

View File

@@ -0,0 +1,25 @@
jQuery( document ).on( 'click', '.notice-dismiss', function() {
const $notice_div= jQuery(this).closest('div.notice');
const notice_name = $notice_div.data('notice-name');
const source = $notice_div.data('source');
const security = $notice_div.data('security');
if ('' !== notice_name) {
jQuery.ajax({
url: ajaxurl,
type: 'post',
data: {
security: security,
action: 'wpdesk_notice_dismiss',
notice_name: notice_name,
source: source,
},
success: function (response) {
}
});
}
});
jQuery( document ).on( 'click', '.notice-dismiss-link', function() {
jQuery(this).closest('div.notice').data('source',jQuery(this).data('source'));
jQuery(this).closest('div.notice').find('.notice-dismiss').click();
});

View File

@@ -0,0 +1,55 @@
{
"name": "wpdesk\/wp-notice",
"description": "Library for displaying Wordpress notices.",
"license": "MIT",
"keywords": [
"wordpress",
"notice",
"admin"
],
"homepage": "https:\/\/gitlab.com\/wpdesk\/wp-notice",
"minimum-stability": "stable",
"authors": [
{
"name": "grola",
"email": "grola@wpdesk.net"
}
],
"config": {
"platform": {
"php": "7.0.8"
},
"allow-plugins": {
"kylekatarnls\/update-helper": true,
"wpdesk\/wp-codeception": true
}
},
"require": {
"php": ">=7.0.8",
"wpdesk\/wp-builder": "^1.0|^2.0"
},
"require-dev": {
"wp-coding-standards\/wpcs": "^0.14.1",
"squizlabs\/php_codesniffer": "^3.0.2",
"mockery\/mockery": "*",
"10up\/wp_mock": "*",
"wimg\/php-compatibility": "^8",
"wpdesk\/wp-codeception": "^2.7"
},
"autoload": {
"psr-4": {
"DPDVendor\\WPDesk\\Notice\\": "src\/WPDesk\/Notice\/"
},
"files": [
"src\/WPDesk\/notice-functions.php"
]
},
"autoload-dev": {},
"scripts": {
"phpcs": "phpcs",
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
"phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
"phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace DPDVendor;
require_once __DIR__ . '/vendor/autoload.php';
if (!\class_exists('DPDVendor\\WPDesk\\Notice\\AjaxHandler')) {
require_once __DIR__ . '/src/WPDesk/Notice/AjaxHandler.php';
}
if (!\class_exists('DPDVendor\\WPDesk\\Notice\\Notice')) {
require_once __DIR__ . 'src/WPDesk/Notice/Notice.php';
}
if (!\class_exists('DPDVendor\\WPDesk\\Notice\\PermanentDismissibleNotice')) {
require_once __DIR__ . '/src/WPDesk/Notice/PermanentDismissibleNotice.php';
}
if (!\class_exists('DPDVendor\\WPDesk\\Notice\\Factory')) {
require_once __DIR__ . '/src/WPDesk/Notice/Factory.php';
}
require_once __DIR__ . '/src/WPDesk/notice-functions.php';

View File

@@ -0,0 +1,90 @@
<?php
namespace DPDVendor\WPDesk\Notice;
use DPDVendor\WPDesk\PluginBuilder\Plugin\HookablePluginDependant;
use DPDVendor\WPDesk\PluginBuilder\Plugin\PluginAccess;
/**
* Class AjaxHandler
*
* AjaxHandler for dismissible notices.
*
* @package WPDesk\Notice
*/
class AjaxHandler implements \DPDVendor\WPDesk\PluginBuilder\Plugin\HookablePluginDependant
{
use PluginAccess;
const POST_FIELD_NOTICE_NAME = 'notice_name';
const POST_FIELD_SOURCE = 'source';
const POST_FIELD_SECURITY = 'security';
const SCRIPTS_VERSION = '4';
const SCRIPT_HANDLE = 'wpdesk_notice';
/**
* @var string
*/
private $assetsURL;
/**
* AjaxHandler constructor.
*
* @param string|null $assetsURL Assets URL.
*/
public function __construct($assetsURL = null)
{
$this->assetsURL = $assetsURL;
}
/**
* Hooks.
*/
public function hooks()
{
if ($this->assetsURL) {
\add_action('admin_enqueue_scripts', [$this, 'enqueueAdminScripts']);
} else {
\add_action('admin_head', [$this, 'addScriptToAdminHead']);
}
\add_action('wp_ajax_wpdesk_notice_dismiss', [$this, 'processAjaxNoticeDismiss']);
}
/**
* Enqueue admin scripts.
*/
public function enqueueAdminScripts()
{
\wp_register_script(self::SCRIPT_HANDLE, \trailingslashit($this->assetsURL) . 'js/notice.js', ['jquery'], self::SCRIPTS_VERSION);
\wp_enqueue_script(self::SCRIPT_HANDLE);
}
/**
* Add Java Script to admin header.
*/
public function addScriptToAdminHead()
{
include __DIR__ . '/views/admin-head-js.php';
}
/**
* Process AJAX notice dismiss.
*
* Updates corresponded WordPress option and fires wpdesk_notice_dismissed_notice action with notice name.
*/
public function processAjaxNoticeDismiss()
{
if (isset($_POST[self::POST_FIELD_NOTICE_NAME])) {
$noticeName = \sanitize_text_field($_POST[self::POST_FIELD_NOTICE_NAME]);
if (isset($_POST[self::POST_FIELD_SOURCE])) {
$source = \sanitize_text_field($_POST[self::POST_FIELD_SOURCE]);
} else {
$source = null;
}
$security = $_POST[self::POST_FIELD_SECURITY] ?? '';
$option_name = \DPDVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $noticeName;
if (\wp_verify_nonce($security, $option_name)) {
\update_option($option_name, \DPDVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_VALUE_DISMISSED);
\do_action('wpdesk_notice_dismissed_notice', $noticeName, $source);
if (\defined('DOING_AJAX') && \DOING_AJAX) {
\wp_send_json_success();
}
}
}
if (\defined('DOING_AJAX') && \DOING_AJAX) {
\wp_send_json_error();
}
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace DPDVendor\WPDesk\Notice;
/**
* Class Factory
*
* Factory for notices.
* @package WPDesk\Notice
*/
class Factory
{
/**
* Creates Notice object.
*
* @param string $noticeType Notice type.
* @param string $noticeContent Notice content.
* @param bool $isDismissible Is dismissible.
* @param int $priority Priority.
*
* @return Notice
*/
public static function notice($noticeContent = '', $noticeType = 'info', $isDismissible = \false, $priority = 10)
{
return new \DPDVendor\WPDesk\Notice\Notice($noticeContent, $noticeType, $isDismissible, $priority);
}
/**
* Creates PermanentDismissibleNotice object.
*
* @param string $noticeContent
* @param string $noticeType
* @param string $noticeName
* @param int $priority
*
* @return PermanentDismissibleNotice
*/
public static function permanentDismissibleNotice($noticeContent = '', $noticeName = '', $noticeType = '', $priority = 10)
{
return new \DPDVendor\WPDesk\Notice\PermanentDismissibleNotice($noticeContent, $noticeName, $noticeType, $priority);
}
}

View File

@@ -0,0 +1,252 @@
<?php
namespace DPDVendor\WPDesk\Notice;
/**
* Class Notice
*
* WordPress admin notice.
* @package WPDesk\Notice
*/
class Notice
{
const NOTICE_TYPE_ERROR = 'error';
const NOTICE_TYPE_WARNING = 'warning';
const NOTICE_TYPE_SUCCESS = 'success';
const NOTICE_TYPE_INFO = 'info';
const ADMIN_FOOTER_BASE_PRIORITY = 9999999;
/**
* Notice type.
*
* @var string
*/
protected $noticeType;
/**
* Notice content.
*
* @var string
*/
protected $noticeContent;
/**
* Is dismissible.
*
* @var bool
*/
protected $dismissible;
/**
* Notice hook priority.
* @var int;
*/
protected $priority;
/**
* Is action added?
* @var bool
*/
private $actionAdded = \false;
/**
* Attributes.
*
* @var string[]
*/
protected $attributes = array();
/**
* Show notice in gutenberg editor.
*
* @var bool
*/
protected $showInGutenberg = \false;
/**
* WPDesk_Flexible_Shipping_Notice constructor.
*
* @param string $noticeContent Notice content.
* @param string $noticeType Notice type.
* @param bool $dismissible Is dismissible.
* @param int $priority Notice priority.
* @param array $attributes Attributes.
* @param bool $showInGutenberg Show notice in gutenberg editor.
*/
public function __construct($noticeContent, $noticeType = 'info', $dismissible = \false, $priority = 10, $attributes = array(), $showInGutenberg = \false)
{
$this->noticeContent = $noticeContent;
$this->noticeType = $noticeType;
$this->dismissible = $dismissible;
$this->priority = $priority;
$this->attributes = $attributes;
$this->showInGutenberg = $showInGutenberg;
$this->addAction();
}
/**
* @return bool
*/
public function isBlockEditor()
{
if (!\function_exists('get_current_screen')) {
require_once \ABSPATH . '/wp-admin/includes/screen.php';
}
$screen = \get_current_screen();
return \is_object($screen) ? $screen->is_block_editor() : \false;
}
/**
* @return string
*/
public function getNoticeContent()
{
return $this->noticeContent;
}
/**
* @param string $noticeContent
*/
public function setNoticeContent($noticeContent)
{
$this->noticeContent = $noticeContent;
}
/**
* @return string
*/
public function getNoticeType()
{
return $this->noticeType;
}
/**
* @param string $noticeType
*/
public function setNoticeType($noticeType)
{
$this->noticeType = $noticeType;
}
/**
* @return bool
*/
public function isDismissible()
{
return $this->dismissible;
}
/**
* @param bool $dismissible
*/
public function setDismissible($dismissible)
{
$this->dismissible = $dismissible;
}
/**
* @return int
*/
public function getPriority()
{
return $this->priority;
}
/**
* @param int $priority
*/
public function setPriority($priority)
{
$this->priority = $priority;
if ($this->actionAdded) {
$this->removeAction();
$this->addAction();
}
}
/**
* Add notice action.
*/
protected function addAction()
{
if (!$this->actionAdded) {
\add_action('admin_notices', [$this, 'showNotice'], $this->priority);
\add_action('admin_footer', [$this, 'showNotice'], self::ADMIN_FOOTER_BASE_PRIORITY + \intval($this->priority));
\add_action('admin_head', [$this, 'addGutenbergScript']);
$this->actionAdded = \true;
}
}
/**
* Remove action.
*/
protected function removeAction()
{
if ($this->actionAdded) {
\remove_action('admin_notices', [$this, 'showNotice'], $this->priority);
\remove_action('admin_footer', [$this, 'showNotice'], self::ADMIN_FOOTER_BASE_PRIORITY + \intval($this->priority));
$this->actionAdded = \false;
}
}
/**
* Enqueue admin scripts.
*/
public function addGutenbergScript()
{
if ($this->isBlockEditor()) {
include_once __DIR__ . '/views/admin-head-js-gutenberg.php';
}
}
/**
* Add attribute.
*
* @param string $name Name
* @param string $value Value.
*/
public function addAttribute($name, $value)
{
$this->attributes[$name] = $value;
}
/**
* Get notice class.
*
* @return string
*/
protected function getNoticeClass()
{
$notice_classes = ['notice'];
if ('updated' === $this->noticeType) {
$notice_classes[] = $this->noticeType;
} else {
$notice_classes[] = 'notice-' . $this->noticeType;
}
if ($this->dismissible) {
$notice_classes[] = 'is-dismissible';
}
if (isset($this->attributes['class'])) {
$notice_classes[] = $this->attributes['class'];
}
if ($this->showInGutenberg) {
$notice_classes[] = 'wpdesk-notice-gutenberg';
}
return \implode(' ', $notice_classes);
}
/**
* Get attributes as string.
*
* @return string
*/
protected function getAttributesAsString()
{
$attribute_string = \sprintf('class="%1$s"', \esc_attr($this->getNoticeClass()));
foreach ($this->attributes as $attribute_name => $attribute_value) {
if ('class' !== $attribute_name) {
$attribute_string .= \sprintf(' %1$s="%2$s"', \esc_html($attribute_name), \esc_attr($attribute_value));
}
}
return $attribute_string;
}
private function addParagraphToContent()
{
if (0 === \strpos($this->noticeContent, '<p>')) {
return \false;
}
if (0 === \strpos($this->noticeContent, '<div>') || 0 === \strpos($this->noticeContent, '<div ')) {
return \false;
}
return \true;
}
/**
* Show notice;
*/
public function showNotice()
{
$this->removeAction();
$noticeFormat = '<div %1$s>%2$s</div>';
if ($this->addParagraphToContent()) {
$noticeFormat = '<div %1$s><p>%2$s</p></div>';
}
echo \sprintf($noticeFormat, $this->getAttributesAsString(), $this->noticeContent);
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace DPDVendor\WPDesk\Notice;
/**
* Class PermanentDismissibleNotice
*
* WordPress admin dismissible notice.
* @package WPDesk\Notice
*/
class PermanentDismissibleNotice extends \DPDVendor\WPDesk\Notice\Notice
{
const OPTION_NAME_PREFIX = 'wpdesk_notice_dismiss_';
const OPTION_VALUE_DISMISSED = '1';
/**
* @var string
*/
private $noticeName;
/**
* @var string
*/
private $noticeSecurity;
/**
* @var string
*/
private $noticeDismissOptionName;
/**
* WPDesk_Flexible_Shipping_Notice constructor.
*
* @param string $noticeContent Notice content.
* @param string $noticeName Notice dismiss option name.
* @param string $noticeType Notice type.
* @param int $priority Priority
* @param array $attributes Attributes.
* @param bool $showInGutenberg Show notice in gutenberg editor.
*/
public function __construct($noticeContent, $noticeName, $noticeType = 'info', $priority = 10, $attributes = array(), $showInGutenberg = \false)
{
parent::__construct($noticeContent, $noticeType, \true, $priority, $attributes, $showInGutenberg);
$this->noticeName = $noticeName;
$this->noticeDismissOptionName = static::OPTION_NAME_PREFIX . $noticeName;
if (self::OPTION_VALUE_DISMISSED === \get_option($this->noticeDismissOptionName, '')) {
$this->removeAction();
} else {
$this->noticeSecurity = \wp_create_nonce($this->noticeDismissOptionName);
}
}
/**
* Undo dismiss notice.
*/
public function undoDismiss()
{
\delete_option($this->noticeDismissOptionName);
$this->addAction();
}
/**
* Get attributes as string.
*
* @return string
*/
protected function getAttributesAsString()
{
$attributesAsString = parent::getAttributesAsString();
$attributesAsString .= \sprintf(' data-notice-name="%1$s"', \esc_attr($this->noticeName));
$attributesAsString .= \sprintf(' data-security="%1$s"', \esc_attr($this->noticeSecurity));
$attributesAsString .= \sprintf(' id="wpdesk-notice-%1$s"', \esc_attr($this->noticeName));
return $attributesAsString;
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace DPDVendor;
if (!\defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
?>
<script type="text/javascript">
<?php
include \dirname(__FILE__, 5) . '/assets/js/gutenberg.js';
?>
</script>
<?php

View File

@@ -0,0 +1,15 @@
<?php
namespace DPDVendor;
if (!\defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
?>
<script type="text/javascript">
<?php
include \dirname(__FILE__, 5) . '/assets/js/notice.js';
?>
</script>
<?php

View File

@@ -0,0 +1,228 @@
<?php
namespace DPDVendor;
if (!\function_exists('DPDVendor\\WPDeskInitWpNoticeAjaxHandler')) {
/**
* Init notices AJAX Handler.
*
* @param string|null $assetsUrl
*
* @return \WPDesk\Notice\AjaxHandler
*/
function WPDeskInitWpNoticeAjaxHandler($assetsUrl = null)
{
$ajax_handler = new \DPDVendor\WPDesk\Notice\AjaxHandler($assetsUrl);
$ajax_handler->hooks();
return $ajax_handler;
}
}
if (!\function_exists('DPDVendor\\wpdesk_init_wp_notice_ajax_handler')) {
/**
* Alias for {@see WPDeskInitNoticeAjaxHandler()} function.
*
* @param null $assetsUrl
*
* @return \WPDesk\Notice\AjaxHandler
*/
function wpdesk_init_wp_notice_ajax_handler($assetsUrl = null)
{
return \DPDVendor\WPDeskInitWpNoticeAjaxHandler($assetsUrl);
}
}
if (!\function_exists('DPDVendor\\WPDeskWpNotice')) {
/**
* Creates Notice.
*
* @param string $noticeContent Notice content.
* @param string $noticeType Notice type.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function WPDeskWpNotice($noticeContent, $noticeType = 'info', $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDesk\Notice\Factory::notice($noticeContent, $noticeType, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\wpdesk_wp_notice')) {
/**
* Creates Notice.
*
* Alias for {@see WPDeskNotice()} function.
*
* @param string $noticeContent Notice content.
* @param string $noticeType Notice type.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function wpdesk_wp_notice($noticeContent, $noticeType = 'info', $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDeskWpNotice($noticeContent, $noticeType, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\WPDeskWpNoticeInfo')) {
/**
* Creates Notice Info.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function WPDeskWpNoticeInfo($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDesk\Notice\Factory::notice($noticeContent, \DPDVendor\WPDesk\Notice\Notice::NOTICE_TYPE_INFO, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\wpdesk_wp_notice_info')) {
/**
* Creates Notice Info.
*
* Alias for {@see WPDeskNoticeInfo()} function.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function wpdesk_wp_notice_info($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDeskWpNoticeInfo($noticeContent, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\WPDeskWpNoticeError')) {
/**
* Creates Notice Error.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function WPDeskWpNoticeError($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDesk\Notice\Factory::notice($noticeContent, \DPDVendor\WPDesk\Notice\Notice::NOTICE_TYPE_ERROR, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\wpdesk_wp_notice_error')) {
/**
* Creates Notice Error.
*
* Alias for {@see WPDeskNoticeError()} function.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function wpdesk_wp_notice_error($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDeskWpNoticeError($noticeContent, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\WPDeskWpNoticeWarning')) {
/**
* Creates Notice Warning.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function WPDeskWpNoticeWarning($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDesk\Notice\Factory::notice($noticeContent, \DPDVendor\WPDesk\Notice\Notice::NOTICE_TYPE_WARNING, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\wpdesk_wp_notice_warning')) {
/**
* Creates Notice Warning.
*
* Alias for {@see WPDeskNoticeWarning()} function.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function wpdesk_wp_notice_warning($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDeskWpNoticeWarning($noticeContent, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\WPDeskWpNoticeSuccess')) {
/**
* Creates Notice Success.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function WPDeskWpNoticeSuccess($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDesk\Notice\Factory::notice($noticeContent, \DPDVendor\WPDesk\Notice\Notice::NOTICE_TYPE_SUCCESS, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\wpdesk_wp_notice_success')) {
/**
* Creates Notice Success.
*
* Alias for {@see WPDeskNoticeSuccess()} function.
*
* @param string $noticeContent Notice content.
* @param bool $dismissible Dismissible notice.
* @param int $priority Notice priority,
*
* @return \WPDesk\Notice\Notice
*/
function wpdesk_wp_notice_success($noticeContent, $dismissible = \false, $priority = 10)
{
return \DPDVendor\WPDeskWpNoticeSuccess($noticeContent, $dismissible, $priority);
}
}
if (!\function_exists('DPDVendor\\WPDeskPermanentDismissibleWpNotice')) {
/**
* Creates Permanent Dismissible Notice.
*
* @param string $noticeContent Notice content.
* @param string $noticeType Notice type.
* @param string $noticeName Notice name.
* @param int $priority Notice priority.
*
* @return \WPDesk\Notice\Notice
*/
function WPDeskPermanentDismissibleWpNotice($noticeContent, $noticeName, $noticeType = 'info', $priority = 10)
{
return \DPDVendor\WPDesk\Notice\Factory::permanentDismissibleNotice($noticeContent, $noticeName, $noticeType, $priority);
}
}
if (!\function_exists('DPDVendor\\wpdesk_permanent_dismissible_wp_notice')) {
/**
* Creates Permanent Dismissible Notice.
*
* Alias for {@see WPDeskPermanentDismissibleNotice()} function.
*
* @param string $noticeContent Notice content.
* @param string $noticeName Notice name.
* @param string $noticeType Notice type.
* @param int $priority Notice priority.
*
* @return \WPDesk\Notice\Notice
*/
function wpdesk_permanent_dismissible_wp_notice($noticeContent, $noticeName, $noticeType = 'info', $priority = 10)
{
return \DPDVendor\WPDeskPermanentDismissibleWpNotice($noticeContent, $noticeName, $noticeType, $priority);
}
}