Converted array() to []
This commit is contained in:
@@ -11,25 +11,25 @@ if (!defined('ABSPATH')) exit;
|
||||
|
||||
class Priority {
|
||||
|
||||
private static $priorities = array(
|
||||
private static $priorities = [
|
||||
'high',
|
||||
'normal',
|
||||
'low',
|
||||
);
|
||||
];
|
||||
|
||||
public static function load() {
|
||||
add_filter('ogrealert/get_active', array(__CLASS__, 'order'), 10, 1);
|
||||
add_filter('ogrealert/get_active', [__CLASS__, 'order'], 10, 1);
|
||||
}
|
||||
|
||||
static function order($alerts) {
|
||||
if (!is_array($alerts) || empty($alerts)) return $alerts;
|
||||
|
||||
$_alerts = array();
|
||||
$_alerts = [];
|
||||
foreach ($alerts as $id) {
|
||||
$_alerts[] = array(
|
||||
$_alerts[] = [
|
||||
'id' => $id,
|
||||
'priority' => self::get($id),
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
usort($_alerts, function ($a, $b) {
|
||||
|
||||
Reference in New Issue
Block a user