File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -58,27 +58,15 @@ public static function registerAddon(
58
58
*
59
59
* @return mixed[] array of Addon objects
60
60
*/
61
- public static function getAll ( string $ type = ' all ' ): array {
61
+ public static function getAll (): array {
62
62
global $ wpdb ;
63
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
- 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
+ );
82
70
}
83
71
84
72
/**
You can’t perform that action at this time.
0 commit comments