Add short name setting to teams and automate display

This commit is contained in:
Brian Miyaji
2018-05-02 12:52:01 +10:00
parent 4b6d23895b
commit bc57f39eba
18 changed files with 44 additions and 50 deletions

View File

@@ -317,9 +317,11 @@ function sp_the_short_name( $post = 0 ) {
echo sp_team_short_name( $post );
}
function sp_get_team_name( $post = 0, $short = true ) {
if ( $short ) {
function sp_team_name( $post = 0, $length = 'full' ) {
if ( 'abbreviation' == $length ) {
return sp_team_abbreviation( $post );
} elseif ( 'short' == $length ) {
return sp_team_short_name( $post );
} else {
return get_the_title( $post );
}