get_the_ID(), 'number' => -1, 'columns' => null, 'highlight' => null, 'show_full_table_link' => false, 'title' => false, 'show_title' => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false, 'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false, 'link_posts' => null, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false, 'rows' => get_option( 'sportspress_table_rows', 10 ), ); extract( $defaults, EXTR_SKIP ); if ( ! isset( $link_posts ) ) { if ( 'player' === sp_get_post_mode( $id ) ) { $link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false; } else { $link_posts = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false; } } if ( ! isset( $highlight ) ) { $highlight = get_post_meta( $id, 'sp_highlight', true ); } $table = new SP_League_Table( $id ); if ( $show_title && false === $title && $id ) : $caption = $table->caption; if ( $caption ) { $title = $caption; } else { $title = get_the_title( $id ); } endif; // Check if we have event status sent from shortcode if ( isset( $show_published_events ) ) { $table->show_published_events = $show_published_events; } if ( isset( $show_future_events ) ) { $table->show_future_events = $show_future_events; } // Create a unique identifier based on the current time in microseconds $identifier = uniqid( 'table_' ); $output = ''; if ( $title ) { $output .= '
| ' . esc_attr__( 'Pos', 'sportspress' ) . ' | '; foreach ( $labels as $key => $label ) : if ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) { $output .= '' . $label . ' | '; } endforeach; $output .= '|
|---|---|---|
| ' . sp_array_value( $row, 'pos' ) . ' | '; $name_class = ''; if ( $show_team_logo ) : if ( has_post_thumbnail( $team_id ) ) : $logo = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' ); $name = '' . $logo . '' . $name; $name_class .= ' has-logo'; endif; endif; if ( $link_posts ) : $permalink = get_post_permalink( $team_id ); $name = '' . $name . ''; endif; $output .= '' . $name . ' | '; foreach ( $labels as $key => $value ) : if ( in_array( $key, array( 'pos', 'name' ) ) ) { continue; } if ( ! is_array( $columns ) || in_array( $key, $columns ) ) { $output .= '' . sp_array_value( $row, $key, '—' ) . ' | '; } endforeach; $output .= '