/**
  * Outputs the admin notices generated by the plugin
  *
  * @uses GVCommon::has_cap()
  * @since 1.12
  *
  * @return void
  */
 public function admin_notice()
 {
     /**
      * @filter `gravityview/admin/notices` Modify the notices displayed in the admin
      * @since 1.12
      */
     $notices = apply_filters('gravityview/admin/notices', self::$admin_notices);
     if (empty($notices) || !$this->check_show_multisite_notices()) {
         return;
     }
     //don't display a message if use has dismissed the message for this version
     // TODO: Use get_user_meta instead of get_transient
     self::$dismissed_notices = isset($_GET['show-dismissed-notices']) ? array() : (array) get_transient('gravityview_dismissed_notices');
     $output = '';
     foreach ($notices as $notice) {
         // If the user doesn't have the capability to see the warning
         if (isset($notice['cap']) && false === GVCommon::has_cap($notice['cap'])) {
             do_action('gravityview_log_debug', 'Notice not shown because user does not have the capability to view it.', $notice);
             continue;
         }
         if (true === $this->is_notice_dismissed($notice)) {
             do_action('gravityview_log_debug', 'Notice not shown because the notice has already been dismissed.', $notice);
             continue;
         }
         $output .= '<div id="message" style="position:relative" class="notice ' . gravityview_sanitize_html_class($notice['class']) . '">';
         // Too cute to leave out.
         $output .= gravityview_get_floaty();
         if (!empty($notice['title'])) {
             $output .= '<h3>' . esc_html($notice['title']) . '</h3>';
         }
         $message = isset($notice['message']) ? $notice['message'] : '';
         if (!empty($notice['dismiss'])) {
             $dismiss = esc_attr($notice['dismiss']);
             $url = esc_url(add_query_arg(array('gv-dismiss' => wp_create_nonce('dismiss'), 'notice' => $dismiss)));
             $align = is_rtl() ? 'alignleft' : 'alignright';
             $message .= '<a href="' . $url . '" data-notice="' . $dismiss . '" class="' . $align . ' button button-link">' . esc_html__('Dismiss', 'gravityview') . '</a></p>';
         }
         $output .= wpautop($message);
         $output .= '<div class="clear"></div>';
         $output .= '</div>';
     }
     echo $output;
     unset($output, $align, $message, $notices);
     //reset the notices handler
     self::$admin_notices = array();
 }
 /**
  * Outputs the admin notices generated by the plugin
  *
  * @since 1.12
  *
  * @return void
  */
 public function admin_notice()
 {
     /**
      * Modify the notices displayed
      * @since 1.12
      */
     $notices = apply_filters('gravityview/admin/notices', self::$admin_notices);
     if (empty($notices) || !$this->check_show_multisite_notices()) {
         return;
     }
     //don't display a message if use has dismissed the message for this version
     self::$dismissed_notices = isset($_GET['show-dismissed-notices']) ? array() : (array) get_transient('gravityview_dismissed_notices');
     foreach ($notices as $notice) {
         if (false === $this->_maybe_show_notice($notice)) {
             continue;
         }
         echo '<div id="message" class="notice ' . gravityview_sanitize_html_class($notice['class']) . '">';
         // Too cute to leave out.
         echo gravityview_get_floaty();
         if (!empty($notice['title'])) {
             echo '<h3>' . esc_html($notice['title']) . '</h3>';
         }
         echo wpautop($notice['message']);
         if (!empty($notice['dismiss'])) {
             $dismiss = esc_attr($notice['dismiss']);
             $url = esc_url(add_query_arg(array('gv-dismiss' => wp_create_nonce('dismiss'), 'notice' => $dismiss)));
             echo wpautop('<a href="' . $url . '" data-notice="' . $dismiss . '" class="button-small button button-secondary">' . esc_html__('Dismiss', 'gravityview') . '</a>');
         }
         echo '<div class="clear"></div>';
         echo '</div>';
     }
     //reset the notices handler
     self::$admin_notices = array();
 }