autoembed( $video_url ); else: $video = ''; endif; if ( $results ): $content = $video . $results . $details . $players . $staff . $content; else: $venue = sportspress_event_venue(); $content = $video . $details . $venue . $players . $staff . $content; endif; endif; return $content; } add_filter( 'the_content', 'sportspress_default_event_content', 7 ); function sportspress_default_calendar_content( $content ) { if ( is_singular( 'sp_calendar' ) && in_the_loop() ): $id = get_the_ID(); $format = get_post_meta( $id, 'sp_format', true ); switch ( $format ): case 'list': $calendar = sportspress_events_list( $id ); break; default: $calendar = sportspress_events_calendar( $id, true, false ); break; endswitch; $content = $calendar . $content; endif; return $content; } add_filter( 'the_content', 'sportspress_default_calendar_content' ); function sportspress_default_team_content( $content ) { if ( is_singular( 'sp_team' ) && in_the_loop() ): $columns = sportspress_team_columns(); $content = $content . $columns; endif; return $content; } add_filter( 'the_content', 'sportspress_default_team_content' ); function sportspress_default_table_content( $content ) { if ( is_singular( 'sp_table' ) && in_the_loop() ): $id = get_the_ID(); $leagues = get_the_terms( $id, 'sp_league' ); $seasons = get_the_terms( $id, 'sp_season' ); $terms = array(); if ( $leagues ): $league = reset( $leagues ); $terms[] = $league->name; endif; if ( $seasons ): $season = reset( $seasons ); $terms[] = $season->name; endif; $title = ''; if ( sizeof( $terms ) ) $title = '

' . implode( ' — ', $terms ) . '

'; $table = sportspress_league_table(); $excerpt = has_excerpt() ? wpautop( get_the_excerpt() ) : ''; $content = $title . $table . $content . $excerpt; endif; return $content; } add_filter( 'the_content', 'sportspress_default_table_content' ); function sportspress_default_player_content( $content ) { if ( is_singular( 'sp_player' ) && in_the_loop() ): $metrics = sportspress_player_metrics(); $statistics = sportspress_player_statistics(); $content .= $metrics . $statistics; endif; return $content; } add_filter( 'the_content', 'sportspress_default_player_content' ); function sportspress_default_list_content( $content ) { if ( is_singular( 'sp_list' ) && in_the_loop() ): $id = get_the_ID(); $format = get_post_meta( $id, 'sp_format', true ); switch ( $format ): case 'gallery': $list = sportspress_player_gallery( $id ); break; default: $list = sportspress_player_list( $id ); break; endswitch; $content = $list . $content; endif; return $content; } add_filter( 'the_content', 'sportspress_default_list_content' );