0, 'div' => 0 ), $atts ) ); // Get all teams in the league $args = array( 'post_type' => 'sp_team', 'numberposts' => -1, 'posts_per_page' => -1, 'tax_query' => array() ); if ( $div ) { $args['tax_query'][] = array( 'taxonomy' => 'sp_league', 'terms' => $div, 'field' => 'term_id' ); } $teams = get_posts( $args ); // Check if there are any teams $size = sizeof( $teams ); if ( $size == 0 ) return false; // Generate table $output = '
| ' . __( 'Position', 'sportspress' ) . ' | '; foreach( $stats as $stat ) { $output .= '' . $sp_table_stats_labels[$stat] . ' | '; } $output .= '
|---|---|
| ' . $club->place . ' ' . ( $club_links ? '' : '' ) . get_the_post_thumbnail( $club->ID, 'crest-small', array( 'title' => $club->post_title, 'class' => 'crest' ) ) . ' ' . $club->post_title . ( $club_links ? '' : '' ) . ' | '; foreach( $stats as $stat ) { $output .= '' . $club_stats[$stat] . ' | '; } } $output.= '