We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 078d5ba commit 795779dCopy full SHA for 795779d
1 file changed
src/Addons.php
@@ -58,27 +58,15 @@ public static function registerAddon(
58
*
59
* @return mixed[] array of Addon objects
60
*/
61
- public static function getAll( string $type = 'all' ): array {
+ public static function getAll(): array {
62
global $wpdb;
63
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
76
77
- 'SELECT * FROM %i ORDER BY type DESC',
78
- $table_name
79
80
81
- }
+ return $wpdb->get_results(
+ $wpdb->prepare(
+ 'SELECT * FROM %i ORDER BY type DESC',
+ self::getTableName(),
+ ),
+ );
82
}
83
84
/**
0 commit comments