Fix empty player lists when no columns
This commit is contained in:
@@ -477,12 +477,11 @@ class SP_Player_List extends SP_Custom_Post {
|
||||
$formats = array();
|
||||
$data = array();
|
||||
$merged = array();
|
||||
$column_order = array();
|
||||
$ordered_columns = array();
|
||||
|
||||
if ( $stats ):
|
||||
|
||||
$column_order = array();
|
||||
|
||||
foreach ( $stats as $stat ):
|
||||
|
||||
// Get post meta
|
||||
@@ -512,6 +511,8 @@ class SP_Player_List extends SP_Custom_Post {
|
||||
|
||||
endforeach;
|
||||
|
||||
endif;
|
||||
|
||||
foreach ( $column_order as $slug ):
|
||||
|
||||
if ( ! in_array( $slug, $this->columns ) ) continue;
|
||||
@@ -610,7 +611,6 @@ class SP_Player_List extends SP_Custom_Post {
|
||||
foreach( $merged as $key => $value ):
|
||||
$data[ $key ] = $tempdata[ $key ];
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if ( $admin ):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user