diff --git a/admin/settings/players.php b/admin/settings/players.php index a269cf3a..5ecfb734 100644 --- a/admin/settings/players.php +++ b/admin/settings/players.php @@ -1,4 +1,9 @@ +

'sp_metric', 'numberposts' => -1, diff --git a/admin/settings/settings.php b/admin/settings/settings.php index 03d70adc..b50407a9 100644 --- a/admin/settings/settings.php +++ b/admin/settings/settings.php @@ -42,14 +42,16 @@ function sportspress_sport_callback() { $selected = sportspress_array_value( $options, 'sport', null ); $custom_sport_name = sportspress_array_value( $options, 'custom_sport_name', null ); ?> - - class="hidden"> +
+ + class="hidden"> +
$selected, 'values' => 'slug', ); - sportspress_dropdown_pages( $args ); + ?> +
+ +
+ +
+ +
+ 'sp_column', 'numberposts' => -1, diff --git a/admin/templates/league-table.php b/admin/templates/league-table.php index 79ccb01d..4e246004 100644 --- a/admin/templates/league-table.php +++ b/admin/templates/league-table.php @@ -5,9 +5,12 @@ if ( !function_exists( 'sportspress_league_table' ) ) { if ( ! $id ) $id = get_the_ID(); + $options = get_option( 'sportspress' ); + $defaults = array( 'columns' => null, 'show_full_table_link' => false, + 'show_team_logo' => sportspress_array_value( $options, 'league_table_show_team_logo', false ), ); $r = wp_parse_args( $args, $defaults ); @@ -44,7 +47,11 @@ if ( !function_exists( 'sportspress_league_table' ) ) { $output .= '' . ( $i + 1 ) . ''; $name = sportspress_array_value( $row, 'name', sportspress_array_value( $row, 'name', ' ' ) ); - $output .= '' . $name . ''; + + if ( $r['show_team_logo'] ) + $name = get_the_post_thumbnail( $team_id, 'sportspress-fit-icon' ) . ' ' . $name; + + $output .= '' . $name . ''; foreach( $labels as $key => $value ): if ( $key == 'name' ) diff --git a/admin/widgets/league-table.php b/admin/widgets/league-table.php index 6c4abb0f..48e170c3 100644 --- a/admin/widgets/league-table.php +++ b/admin/widgets/league-table.php @@ -11,12 +11,13 @@ class SportsPress_Widget_League_Table extends WP_Widget { $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $id = empty($instance['id']) ? null : $instance['id']; $columns = empty($instance['columns']) ? null : $instance['columns']; + $show_team_logo = empty($instance['show_team_logo']) ? false : $instance['show_team_logo']; $show_full_table_link = empty($instance['show_full_table_link']) ? false : $instance['show_full_table_link']; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
'; - echo sportspress_league_table( $id, array( 'columns' => $columns, 'show_full_table_link' => $show_full_table_link ) ); + echo sportspress_league_table( $id, array( 'columns' => $columns, 'show_full_table_link' => $show_full_table_link, 'show_team_logo' => $show_team_logo ) ); echo '
'; echo $after_widget; } @@ -26,16 +27,18 @@ class SportsPress_Widget_League_Table extends WP_Widget { $instance['title'] = strip_tags($new_instance['title']); $instance['id'] = intval($new_instance['id']); $instance['columns'] = (array)$new_instance['columns']; + $instance['show_team_logo'] = $new_instance['show_team_logo']; $instance['show_full_table_link'] = $new_instance['show_full_table_link']; return $instance; } function form( $instance ) { - $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'columns' => null, 'show_full_table_link' => true ) ); + $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'id' => '', 'columns' => null, 'show_team_logo' => false, 'show_full_table_link' => true ) ); $title = strip_tags($instance['title']); $id = intval($instance['id']); $columns = $instance['columns']; + $show_team_logo = $instance['show_team_logo']; $show_full_table_link = $instance['show_full_table_link']; ?>

@@ -77,7 +80,10 @@ class SportsPress_Widget_League_Table extends WP_Widget {

-

> +

> +
+ + >