From 928ba49c3bf35b5c498bcfa2bf0f2969fd4e534b Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Tue, 29 Apr 2014 14:09:12 +1000 Subject: [PATCH] Display players as total count in admin --- includes/admin/post-types/class-sp-admin-cpt-list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/post-types/class-sp-admin-cpt-list.php b/includes/admin/post-types/class-sp-admin-cpt-list.php index 28e1ed7b..c3a38e0d 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-list.php +++ b/includes/admin/post-types/class-sp-admin-cpt-list.php @@ -46,10 +46,10 @@ class SP_Admin_CPT_List extends SP_Admin_CPT { $columns = array( 'cb' => '', 'title' => __( 'Title', 'sportspress' ), - 'sp_player' => __( 'Players', 'sportspress' ), 'sp_league' => __( 'League', 'sportspress' ), 'sp_season' => __( 'Season', 'sportspress' ), 'sp_team' => __( 'Team', 'sportspress' ), + 'sp_player' => __( 'Players', 'sportspress' ), 'sp_views' => __( 'Views', 'sportspress' ), ); return $columns; @@ -62,7 +62,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT { public function custom_columns( $column, $post_id ) { switch ( $column ): case 'sp_player': - echo sp_posts( $post_id, 'sp_player' ); + echo sizeof( array_filter( get_post_meta( $post_id, 'sp_player' ) ) ); break; case 'sp_league': echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';