Skip to content

Commit abbfaec

Browse files
committed
Change function order
1 parent 6341d18 commit abbfaec

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

inc/tag.class.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,23 @@ public static function getBlacklistItemtype()
7575
*/
7676
public static function canItemtype($itemtype = '')
7777
{
78+
if (empty($itemtype) || !class_exists($itemtype) || in_array($itemtype, self::getBlacklistItemtype())) {
79+
return false;
80+
}
81+
7882
$tags = new self();
7983
$types_menu = [];
8084
$use_global_tag = false;
85+
8186
foreach ($tags->find(['is_active' => 1]) as $tag) {
82-
if ($tag['type_menu'] != null) {
87+
if (!empty($tag['type_menu'])) {
8388
$types_menu = array_merge($types_menu, json_decode($tag['type_menu']));
8489
} else {
8590
$use_global_tag = true;
8691
}
8792
}
88-
return !empty($itemtype) &&
89-
class_exists($itemtype) &&
90-
!in_array($itemtype, self::getBlacklistItemtype()) &&
91-
($use_global_tag || in_array($itemtype, $types_menu));
93+
94+
return $use_global_tag || in_array($itemtype, $types_menu);
9295
}
9396

9497
public function showForm($ID, $options = [])

0 commit comments

Comments
 (0)