Skip to content
Snippets Groups Projects
Select Git revision
  • 8f22d9a79b503bc611b34f65d724fca95baa1926
  • master default protected
  • bugfix/wordpress-review
  • fix/duplicate
  • bugfix/get_current_screen_fail
  • feature/dismiss-nonce
  • replace-dodgy-path
  • bugfix/notice-not-show
  • devel
  • 3.3.0
  • 3.2.5
  • 3.2.4
  • 3.2.3
  • 3.2.2
  • 3.2.1
  • 3.2.0
  • 3.2.0-beta7
  • 3.2.0-beta6
  • 3.2.0-beta5
  • 3.2.0-beta4
  • 3.2.0-beta3
  • 3.2.0-beta2
  • 3.2.0-beta1
  • 3.1.4
  • 3.1.4-beta1
  • 3.1.3
  • 3.1.1
  • 3.1
  • 3.0
29 results

notice-functions.php

Blame
  • notice-functions.php 7.51 KiB
    <?php
    
    if (!function_exists('WPDeskInitNoticeAjaxHandler')) {
        /**
         * Init notices AJAX Handler.
         *
         * @param string|null $assetsUrl
         *
         * @return \WPDesk\Notice\AjaxHandler
         */
        function WPDeskInitNoticeAjaxHandler($assetsUrl = null)
        {
            $ajax_handler = new \WPDesk\Notice\AjaxHandler($assetsUrl);
            $ajax_handler->hooks();
            return $ajax_handler;
        }
    }
    
    if (!function_exists('wpdesk_init_notice_ajax_handler')) {
        /**
         * Alias for {@see WPDeskInitNoticeAjaxHandler()} function.
         *
         * @param null $assetsUrl
         *
         * @return \WPDesk\Notice\AjaxHandler
         */
        function wpdesk_init_notice_ajax_handler($assetsUrl = null)
        {
            return WPDeskInitNoticeAjaxHandler($assetsUrl);
        }
    }
    
    if (!function_exists('WPDeskNotice')) {
        /**
         * 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 WPDeskNotice($noticeContent, $noticeType = 'info', $dismissible = false, $priority = 10)
        {
            return \WPDesk\Notice\Factory::notice($noticeContent, $noticeType, $dismissible, $priority);
        }
    }
    
    if (!function_exists('wpdesk_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_notice($noticeContent, $noticeType = 'info', $dismissible = false, $priority = 10)
        {
            return WPDeskNotice($noticeContent, $noticeType, $dismissible, $priority);
        }
    }
    
    if (!function_exists('WPDeskNoticeInfo')) {
        /**