diff --git a/admin/templates/events-calendar.php b/admin/templates/events-calendar.php index 0ee4e8a4..d13aeac7 100644 --- a/admin/templates/events-calendar.php +++ b/admin/templates/events-calendar.php @@ -197,7 +197,7 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) { $calendar_output .= "\n\t\n\t\n\t"; if ( $id && $r['show_all_events_link'] ) - $calendar_output .= '' . __( 'View all events', 'sportspress' ) . ''; + $calendar_output .= '' . __( 'View all events', 'sportspress' ) . ''; return apply_filters( 'sportspress_events_calendar', $calendar_output ); diff --git a/admin/templates/events-list.php b/admin/templates/events-list.php index 7f80f000..3c6bc99e 100644 --- a/admin/templates/events-list.php +++ b/admin/templates/events-list.php @@ -117,7 +117,7 @@ if ( !function_exists( 'sportspress_events_list' ) ) { $output .= '' . ''; if ( $id && $r['show_all_events_link'] ) - $output .= '' . __( 'View all events', 'sportspress' ) . ''; + $output .= '' . __( 'View all events', 'sportspress' ) . ''; $output .= ''; diff --git a/admin/templates/player-list.php b/admin/templates/player-list.php index b300883b..ac17ec2c 100644 --- a/admin/templates/player-list.php +++ b/admin/templates/player-list.php @@ -6,9 +6,11 @@ if ( !function_exists( 'sportspress_player_list' ) ) { $id = get_the_ID(); $defaults = array( + 'number' => -1, 'statistics' => null, 'orderby' => 'default', 'order' => 'ASC', + 'show_all_players_link' => false, ); $r = wp_parse_args( $args, $defaults ); @@ -55,7 +57,11 @@ if ( !function_exists( 'sportspress_player_list' ) ) { $i = 0; + if ( is_int( $r['number'] ) && $r['number'] > 0 ) + $limit = $r['number']; + foreach( $data as $player_id => $row ): + if ( isset( $limit ) && $i >= $limit ) continue; $name = sportspress_array_value( $row, 'name', null ); if ( ! $name ) continue; @@ -89,6 +95,9 @@ if ( !function_exists( 'sportspress_player_list' ) ) { $output .= '' . '' . ''; + if ( $r['show_all_players_link'] ) + $output .= '' . __( 'View all players', 'sportspress' ) . ''; + return apply_filters( 'sportspress_player_list', $output ); } diff --git a/admin/widgets/player-list.php b/admin/widgets/player-list.php index e5aa19dd..37115f09 100644 --- a/admin/widgets/player-list.php +++ b/admin/widgets/player-list.php @@ -10,14 +10,16 @@ class SportsPress_Widget_Player_list extends WP_Widget { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $id = empty($instance['id']) ? null : $instance['id']; + $number = empty($instance['number']) ? null : $instance['number']; $statistics = $instance['statistics']; $orderby = empty($instance['orderby']) ? 'default' : $instance['orderby']; $order = empty($instance['order']) ? 'ASC' : $instance['order']; + $show_all_players_link = empty($instance['show_all_players_link']) ? false : $instance['show_all_players_link']; echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; echo '
@@ -60,6 +66,9 @@ class SportsPress_Widget_Player_list extends WP_Widget { ?> +
+
+
>
> +