Skip to content

Commit 795779d

Browse files
committed
Remove unused arg from Addons::getAll()
1 parent 078d5ba commit 795779d

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

src/Addons.php

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,15 @@ public static function registerAddon(
5858
*
5959
* @return mixed[] array of Addon objects
6060
*/
61-
public static function getAll( string $type = 'all' ): array {
61+
public static function getAll(): array {
6262
global $wpdb;
6363

64-
$table_name = self::getTableName();
65-
66-
if ( $type !== 'all' ) {
67-
return $wpdb->get_results(
68-
$wpdb->prepare(
69-
'SELECT * FROM %i WHERE type = %s ORDER BY type DESC',
70-
$table_name,
71-
$type
72-
)
73-
);
74-
} else {
75-
return $wpdb->get_results(
76-
$wpdb->prepare(
77-
'SELECT * FROM %i ORDER BY type DESC',
78-
$table_name
79-
)
80-
);
81-
}
64+
return $wpdb->get_results(
65+
$wpdb->prepare(
66+
'SELECT * FROM %i ORDER BY type DESC',
67+
self::getTableName(),
68+
),
69+
);
8270
}
8371

8472
/**

0 commit comments

Comments
 (0)