Abbreviate team names independently

This commit is contained in:
Brian Miyaji
2016-04-13 23:59:21 +10:00
parent 99c29a0766
commit 6ba028f2cf
11 changed files with 31 additions and 26 deletions

View File

@@ -268,18 +268,6 @@ function sportspress_team_permalink( $permalink, $post ) {
}
add_filter( 'post_type_link', 'sportspress_team_permalink', 10, 2 );
function sportspress_abbreviate_team( $title, $id = null ) {
if ( ! is_admin() && 'sp_team' == get_post_type( $id ) && get_option( 'sportspress_abbreviate_teams', 'yes' ) == 'yes' ):
if ( in_the_loop() && get_the_ID() == $id ) return $title;
$abbreviation = get_post_meta( $id, 'sp_abbreviation', true );
if ( ! empty( $abbreviation ) ):
return $abbreviation;
endif;
endif;
return $title;
}
add_filter( 'the_title', 'sportspress_abbreviate_team', 10, 2 );
function sportspress_no_terms_links( $term_list, $taxonomy ) {
if ( in_array( $taxonomy, array( 'sp_league', 'sp_season', 'sp_position', 'sp_role' ) ) )