$type, 'content' => $content ); TagGroups_Options::update_option('tag_group_admin_notice', $notices); } } /** * Check if an admin notice is pending and, if necessary, display it * * @param void * @return void */ public static function display() { $notices = TagGroups_Options::get_option('tag_group_admin_notice', array()); if (! empty($notices)) { foreach ($notices as $notice) { if ('cache' == $notice['type']) { $notice['type'] = 'info'; $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://'; $ajax_link = admin_url('admin-ajax.php?', $protocol); } else { $ajax_link = ''; } // wrap the message in
if not already a complex formatting if (strpos('', $notice['content']) === false) { $notice['content'] = '
' . $notice['content'] . '
'; } $view = new TagGroups_View('partials/admin_notice'); $view->set(array( 'ajax_link' => $ajax_link, 'notice' => $notice, )); $view->render(); } update_option('tag_group_admin_notice', array()); } } } }