Add abbreviation to event outcomes

This commit is contained in:
Brian Miyaji
2014-06-25 12:49:43 +10:00
parent 743d60c6ec
commit e0852ae9aa
8 changed files with 66 additions and 18 deletions

View File

@@ -197,13 +197,18 @@ class SP_Team extends SP_Custom_Post {
'name' => $streak['name'],
'post_type' => 'sp_outcome',
'post_status' => 'publish',
'posts_per_page' => 1
'posts_per_page' => 1,
'orderby' => 'menu_order',
'order' => 'ASC',
);
$outcomes = get_posts( $args );
if ( $outcomes ):
$outcome = reset( $outcomes );
$totals['streak'] = $outcome->post_title . $streak['count'];
$abbreviation = get_post_meta( $outcome->ID, 'sp_abbreviation', true );
if ( ! $abbreviation )
$abbreviation = substr( $outcome->post_title, 0, 1 );
$totals['streak'] = $abbreviation . $streak['count'];
endif;
// Add last counters to totals