Avoid loading ALL players at the first step of creating a Player List

This commit is contained in:
savvasha
2018-08-29 06:47:59 +03:00
parent ab4cdc52f0
commit bf50beb953

View File

@@ -19,10 +19,15 @@ class SP_Meta_Box_List_Data {
* Output the metabox
*/
public static function output( $post ) {
$list = new SP_Player_List( $post );
list( $columns, $data, $placeholders, $merged, $orderby ) = $list->data( true );
$adjustments = $list->adjustments;
self::table( $columns, $data, $placeholders, $adjustments, $orderby );
global $pagenow;
if ( is_admin() && in_array( $pagenow, array( 'post-new.php' ) ) && 'sp_list' == get_post_type() ) {
self::table( );
}else{
$list = new SP_Player_List( $post );
list( $columns, $data, $placeholders, $merged, $orderby ) = $list->data( true );
$adjustments = $list->adjustments;
self::table( $columns, $data, $placeholders, $adjustments, $orderby );
}
}
/**