has_active function with ogrealert/has_active filter.
This commit is contained in:
@@ -18,7 +18,7 @@ class Display {
|
||||
}
|
||||
|
||||
static function init() {
|
||||
if (empty(\OgreAlert\Alert::get_active())) return;
|
||||
if (!\OgreAlert\Alert::has_active()) return;
|
||||
|
||||
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
|
||||
|
||||
@@ -47,11 +47,10 @@ class Display {
|
||||
}
|
||||
|
||||
static function display_alerts() {
|
||||
$ids = \OgreAlert\Alert::get_active();
|
||||
if (empty($ids)) return;
|
||||
if (!\OgreAlert\Alert::has_active()) return;
|
||||
|
||||
self::load_template('loop-start');
|
||||
foreach ($ids as $id) {
|
||||
foreach (\OgreAlert\Alert::get_active() as $id) {
|
||||
self::load_template('alert', \OgreAlert\Priority::get($id), true, array('id' => $id));
|
||||
}
|
||||
self::load_template('loop-end');
|
||||
|
||||
Reference in New Issue
Block a user