Compare commits

...

10 Commits

Author SHA1 Message Date
91b572ab75 add the class with team index to event list 2023-12-29 18:37:44 -06:00
8fb86314eb update metadata for "tony" 2023-12-29 18:37:14 -06:00
savvasha
6b02e867ba Fix: -None- option dissapeared 2023-12-29 16:23:47 +02:00
Brian Miyaji
9a2af2e387 Tag version 2.7.17 2023-12-11 16:57:26 +09:00
Brian Miyaji
a085ce0920 Merge pull request #451 from kadimi/master
Fix "Warning: A non-numeric value encountered"
2023-12-11 16:47:35 +09:00
Nabil Kadimi
3cb5d2a679 Fix "Warning: A non-numeric value encountered" 2023-12-11 00:06:30 +01:00
savvasha
3ea7cb6a4e FIX: PHP8.2.x Deprecated code warnings 2023-10-03 10:40:03 +03:00
savvasha
eb444db5b8 FIX: Use of undefined constant SP_PLUGIN_FILE
FIX: Use of undefined constant SP_PLUGIN_FILE - assumed 'SP_PLUGIN_FILE' (this will throw an Error in a future version of PHP)
2023-05-07 17:16:44 +03:00
savvasha
16b0a3e3a1 Next team was not working with shortcodes 2023-04-12 11:40:03 +03:00
savvasha
719712d3d7 Add a hook to alter $query args. 2023-04-07 17:10:30 +03:00
9 changed files with 60 additions and 31 deletions

View File

@@ -1,5 +1,11 @@
== SportsPress Changelog == == SportsPress Changelog ==
= 2.7.17 =
* Fix - PHP 8.2.x deprecated code warnings.
* Fix - Next team not working in shortcodes.
* Fix - Links rendering in event specs.
* Localization - Update translatable strings.
= 2.7.16 = = 2.7.16 =
* Update - WP version tested up to 6.1. * Update - WP version tested up to 6.1.
* Update - Leaflet version to 1.8.0. * Update - Leaflet version to 1.8.0.

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy * @author ThemeBoy
* @category Admin * @category Admin
* @package SportsPress/Admin * @package SportsPress/Admin
* @version 2.7.13 * @version 2.7.17
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@@ -19,6 +19,11 @@ if ( ! class_exists( 'SP_Admin_Permalink_Settings' ) ) :
*/ */
class SP_Admin_Permalink_Settings { class SP_Admin_Permalink_Settings {
/**
* @var array
*/
public $slugs = array();
/** /**
* Hook in tabs. * Hook in tabs.
*/ */

View File

@@ -23,6 +23,9 @@ if ( ! class_exists( 'SP_Install' ) ) :
* Hook in tabs. * Hook in tabs.
*/ */
public function __construct() { public function __construct() {
if ( ! defined( 'SP_PLUGIN_FILE' ) ) {
define( 'SP_PLUGIN_FILE', __FILE__ );
}
register_activation_hook( SP_PLUGIN_FILE, array( $this, 'install' ) ); register_activation_hook( SP_PLUGIN_FILE, array( $this, 'install' ) );
if ( defined( 'SP_PRO_PLUGIN_FILE' ) ) { if ( defined( 'SP_PRO_PLUGIN_FILE' ) ) {

View File

@@ -5,7 +5,7 @@
* The SportsPress league table class handles individual league table data. * The SportsPress league table class handles individual league table data.
* *
* @class SP_League_Table * @class SP_League_Table
* @version 2.7.9 * @version 2.7.17
* @package SportsPress/Classes * @package SportsPress/Classes
* @category Class * @category Class
* @author ThemeBoy * @author ThemeBoy
@@ -27,6 +27,7 @@ class SP_League_Table extends SP_Secondary_Post {
// ** @var strings // ** @var strings
public $orderby; public $orderby;
public $orderbyorder; public $orderbyorder;
public $compare;
/** @var int Show Published events. */ /** @var int Show Published events. */
public $show_published_events; public $show_published_events;
@@ -392,24 +393,24 @@ class SP_League_Table extends SP_Secondary_Post {
// Increment events played and outcome count // Increment events played and outcome count
if ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $outcome, $totals[ $team_id ] ) ) : if ( array_key_exists( $team_id, $totals ) && is_array( $totals[ $team_id ] ) && array_key_exists( $outcome, $totals[ $team_id ] ) ) :
$totals[ $team_id ]['eventsplayed'] ++; $totals[ $team_id ]['eventsplayed'] ++;
$totals[ $team_id ]['eventminutes'] += $minutes; $totals[ $team_id ]['eventminutes'] = (int) $totals[ $team_id ]['eventminutes'] + $minutes;
$totals[ $team_id ][ $outcome ] ++; $totals[ $team_id ][ $outcome ] ++;
// Add to home or away stats // Add to home or away stats
if ( 0 === $i ) : if ( 0 === $i ) :
$totals[ $team_id ]['eventsplayed_home'] ++; $totals[ $team_id ]['eventsplayed_home'] ++;
$totals[ $team_id ]['eventminutes_home'] += $minutes; $totals[ $team_id ]['eventminutes_home'] = (int) $totals[ $team_id ]['eventminutes_home'] + $minutes;
$totals[ $team_id ][ $outcome . '_home' ] ++; $totals[ $team_id ][ $outcome . '_home' ] ++;
else : else :
$totals[ $team_id ]['eventsplayed_away'] ++; $totals[ $team_id ]['eventsplayed_away'] ++;
$totals[ $team_id ]['eventminutes_away'] += $minutes; $totals[ $team_id ]['eventminutes_away'] = (int) $totals[ $team_id ]['eventminutes_away'] + $minutes;
$totals[ $team_id ][ $outcome . '_away' ] ++; $totals[ $team_id ][ $outcome . '_away' ] ++;
endif; endif;
// Add to venue stats // Add to venue stats
if ( sp_is_home_venue( $team_id, $event->ID ) ) : if ( sp_is_home_venue( $team_id, $event->ID ) ) :
$totals[ $team_id ]['eventsplayed_venue'] ++; $totals[ $team_id ]['eventsplayed_venue'] ++;
$totals[ $team_id ]['eventminutes_venue'] += $minutes; $totals[ $team_id ]['eventminutes_venue'] = (int) $totals[ $team_id ]['eventminutes_venue'] + $minutes;
$totals[ $team_id ][ $outcome . '_venue' ] ++; $totals[ $team_id ][ $outcome . '_venue' ] ++;
endif; endif;
endif; endif;

View File

@@ -7,7 +7,7 @@
* @author ThemeBoy * @author ThemeBoy
* @category Core * @category Core
* @package SportsPress/Functions * @package SportsPress/Functions
* @version 2.7.15 * @version 2.7.17
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@@ -846,7 +846,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
'hide_empty' => false, 'hide_empty' => false,
'values' => 'slug', 'values' => 'slug',
'class' => null, 'class' => null,
'property' => null, 'property' => 'none',
'placeholder' => null, 'placeholder' => null,
'chosen' => false, 'chosen' => false,
'parent' => 0, 'parent' => 0,
@@ -885,7 +885,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
if ( $terms ) : if ( $terms ) :
printf( '<select name="%s" class="postform %s" %s>', esc_attr( $name ), esc_attr( $class ) . ( $chosen ? ' chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ) : '' ), ( $placeholder != null ? 'data-placeholder="' . esc_attr( $placeholder ) . '" ' : '' ) . esc_attr( $property ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped printf( '<select name="%s" class="postform %s" %s>', esc_attr( $name ), esc_attr( $class ) . ( $chosen ? ' chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ) : '' ), ( $placeholder != null ? 'data-placeholder="' . esc_attr( $placeholder ) . '" ' : '' ) . esc_attr( $property ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( strpos( $property, 'multiple' ) === false ) : if ( $property && strpos( $property, 'multiple' ) === false ) :
if ( $args['show_option_blank'] ) : if ( $args['show_option_blank'] ) :
echo '<option value="">' . ( is_bool( $args['show_option_blank'] ) ? '' : esc_attr( $args['show_option_blank'] ) ) . '</option>'; echo '<option value="">' . ( is_bool( $args['show_option_blank'] ) ? '' : esc_attr( $args['show_option_blank'] ) ) . '</option>';
endif; endif;
@@ -898,7 +898,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
endif; endif;
if ( $args['show_option_auto'] ) : if ( $args['show_option_auto'] ) :
if ( strpos( $property, 'multiple' ) !== false ) : if ( $property && strpos( $property, 'multiple' ) !== false ) :
$selected_prop = in_array( 'auto', $selected ) ? 'selected' : ''; $selected_prop = in_array( 'auto', $selected ) ? 'selected' : '';
else : else :
$selected_prop = selected( 'auto', $selected, false ); $selected_prop = selected( 'auto', $selected, false );
@@ -914,7 +914,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
$this_value = $term->slug; $this_value = $term->slug;
endif; endif;
if ( strpos( $property, 'multiple' ) !== false ) : if ( $property && strpos( $property, 'multiple' ) !== false ) :
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : ''; $selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
else : else :
$selected_prop = selected( $this_value, $selected, false ); $selected_prop = selected( $this_value, $selected, false );
@@ -934,7 +934,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
$this_value = $term_child->slug; $this_value = $term_child->slug;
endif; endif;
if ( strpos( $property, 'multiple' ) !== false ) : if ( $property && strpos( $property, 'multiple' ) !== false ) :
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : ''; $selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
else : else :
$selected_prop = selected( $this_value, $selected, false ); $selected_prop = selected( $this_value, $selected, false );
@@ -982,7 +982,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
'post_status' => 'publish', 'post_status' => 'publish',
'values' => 'post_name', 'values' => 'post_name',
'class' => null, 'class' => null,
'property' => null, 'property' => 'none',
'placeholder' => null, 'placeholder' => null,
'chosen' => false, 'chosen' => false,
'filter' => false, 'filter' => false,
@@ -1020,7 +1020,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
if ( $posts || $args['prepend_options'] || $args['append_options'] ) : if ( $posts || $args['prepend_options'] || $args['append_options'] ) :
printf( '<select name="%s" id="%s" class="postform %s" %s>', esc_attr( $name ), esc_attr( $id ), esc_attr( $class ) . ( $chosen ? ' chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ) : '' ), ( $placeholder != null ? 'data-placeholder="' . esc_attr( $placeholder ) . '" ' : '' ) . esc_attr( $property ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped printf( '<select name="%s" id="%s" class="postform %s" %s>', esc_attr( $name ), esc_attr( $id ), esc_attr( $class ) . ( $chosen ? ' chosen-select' . ( is_rtl() ? ' chosen-rtl' : '' ) : '' ), ( $placeholder != null ? 'data-placeholder="' . esc_attr( $placeholder ) . '" ' : '' ) . esc_attr( $property ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if ( strpos( $property, 'multiple' ) === false ) : if ( $property && strpos( $property, 'multiple' ) === false ) :
if ( $args['show_option_blank'] ) : if ( $args['show_option_blank'] ) :
printf( '<option value=""></option>' ); printf( '<option value=""></option>' );
endif; endif;
@@ -1046,7 +1046,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
$this_value = $post->post_name; $this_value = $post->post_name;
endif; endif;
if ( strpos( $property, 'multiple' ) !== false ) : if ( $property && strpos( $property, 'multiple' ) !== false ) :
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : ''; $selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
else : else :
$selected_prop = selected( $this_value, $selected, false ); $selected_prop = selected( $this_value, $selected, false );
@@ -1066,7 +1066,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
endforeach; endforeach;
wp_reset_postdata(); wp_reset_postdata();
if ( strpos( $property, 'multiple' ) === false ) : if ( $property && strpos( $property, 'multiple' ) === false ) :
if ( $args['append_options'] && is_array( $args['append_options'] ) ) : if ( $args['append_options'] && is_array( $args['append_options'] ) ) :
foreach ( $args['append_options'] as $slug => $label ) : foreach ( $args['append_options'] as $slug => $label ) :
printf( '<option value="%s" %s>%s</option>', esc_attr( $slug ), selected( $selected, $slug, false ), esc_attr( $label ) ); printf( '<option value="%s" %s>%s</option>', esc_attr( $slug ), selected( $selected, $slug, false ), esc_attr( $label ) );
@@ -1156,6 +1156,8 @@ if ( ! function_exists( 'sp_post_checklist' ) ) {
$query['orderby'] = 'meta_value_num'; $query['orderby'] = 'meta_value_num';
$query['order'] = 'ASC'; $query['order'] = 'ASC';
endif; endif;
// Add a hook to alter $query args.
$query = apply_filters( 'sportspress_sp_post_checklist_args', $query, $meta );
$posts = get_posts( $query ); $posts = get_posts( $query );
endif; endif;
foreach ( $posts as $post ) : foreach ( $posts as $post ) :

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy * @author ThemeBoy
* @category Modules * @category Modules
* @package SportsPress/Modules * @package SportsPress/Modules
* @version 2.7.9 * @version 2.7.17
*/ */
// Exit if accessed directly // Exit if accessed directly
@@ -19,7 +19,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
* Main SportsPress Next Team Preset Class * Main SportsPress Next Team Preset Class
* *
* @class SportsPress_Next_Team_Preset * @class SportsPress_Next_Team_Preset
* @version 2.6.3 * @version 2.7.17
*/ */
class SportsPress_Next_Team_Preset { class SportsPress_Next_Team_Preset {
@@ -49,7 +49,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
*/ */
private function define_constants() { private function define_constants() {
if ( ! defined( 'SP_NEXT_TEAM_PRESET_VERSION' ) ) { if ( ! defined( 'SP_NEXT_TEAM_PRESET_VERSION' ) ) {
define( 'SP_NEXT_TEAM_PRESET_VERSION', '2.6.3' ); define( 'SP_NEXT_TEAM_PRESET_VERSION', '2.7.17' );
} }
if ( ! defined( 'SP_NEXT_TEAM_PRESET_URL' ) ) { if ( ! defined( 'SP_NEXT_TEAM_PRESET_URL' ) ) {
@@ -104,7 +104,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
); );
if ( get_option( 'sportspress_table_next_team_filter_league', 'no' ) === 'yes' ) { if ( get_option( 'sportspress_table_next_team_filter_league', 'no' ) === 'yes' ) {
$leagues = get_the_terms( get_the_ID(), 'sp_league' ); $leagues = get_the_terms( $post_id, 'sp_league' );
if ( ! isset( $league_ids ) ) { if ( ! isset( $league_ids ) ) {
$league_ids = array(); $league_ids = array();
} }
@@ -113,7 +113,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
$league_ids[] = $league->term_id; $league_ids[] = $league->term_id;
endforeach; endforeach;
endif; endif;
$league_ids = sp_add_auto_term( $league_ids, get_the_ID(), 'sp_league' ); $league_ids = sp_add_auto_term( $league_ids, $post_id, 'sp_league' );
if ( isset( $league_ids ) ) { if ( isset( $league_ids ) ) {
$args['tax_query'][] = array( $args['tax_query'][] = array(

View File

@@ -3,8 +3,8 @@ Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochester
Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
Donate link: http://tboy.co/donate Donate link: http://tboy.co/donate
Requires at least: 3.8 Requires at least: 3.8
Tested up to: 6.1 Tested up to: 6.4
Stable tag: 2.7.16 Stable tag: 2.7.17
License: GPLv3 License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -240,6 +240,12 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
== Changelog == == Changelog ==
= 2.7.17 =
* Fix - PHP 8.2.x deprecated code warnings.
* Fix - Next team not working in shortcodes.
* Fix - Links rendering in event specs.
* Localization - Update translatable strings.
= 2.7.16 = = 2.7.16 =
* Update - WP version tested up to 6.1. * Update - WP version tested up to 6.1.
* Update - Leaflet version to 1.8.0. * Update - Leaflet version to 1.8.0.

View File

@@ -1,9 +1,9 @@
<?php <?php
/** /**
* Plugin Name: SportsPress * Plugin Name: Tony's SportsPress
* Plugin URI: http://themeboy.com/sportspress/ * Plugin URI: http://themeboy.com/sportspress/
* Description: Manage your club and its players, staff, events, league tables, and player lists. * Description: Manage your club and its players, staff, events, league tables, and player lists.
* Version: 2.7.16 * Version: 2.7.17
* Author: ThemeBoy * Author: ThemeBoy
* Author URI: http://themeboy.com * Author URI: http://themeboy.com
* Requires at least: 3.8 * Requires at least: 3.8
@@ -12,9 +12,9 @@
* Text Domain: sportspress * Text Domain: sportspress
* Domain Path: /languages/ * Domain Path: /languages/
* *
* @package SportsPress * @package TonysSportsPress
* @category Core * @category Core
* @author ThemeBoy * @author Tony
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly exit; // Exit if accessed directly
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
* Main SportsPress Class * Main SportsPress Class
* *
* @class SportsPress * @class SportsPress
* @version 2.7.16 * @version 2.7.17
*/ */
final class SportsPress { final class SportsPress {
/** /**
* @var string * @var string
*/ */
public $version = '2.7.16'; public $version = '2.7.17';
/** /**
* @var SportsPress The single instance of the class * @var SportsPress The single instance of the class
@@ -60,6 +60,11 @@ if ( ! class_exists( 'SportsPress' ) ) :
* @var SP_Templates $templates * @var SP_Templates $templates
*/ */
public $templates = null; public $templates = null;
/**
* @var SP_Feeds $feeds
*/
public $feeds = null;
/** /**
* @var array * @var array

View File

@@ -253,6 +253,7 @@ $identifier = uniqid( 'eventlist_' );
$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
if ( $reverse_teams ) { if ( $reverse_teams ) {
$main_results = array_reverse( $main_results, true ); $main_results = array_reverse( $main_results, true );
$teams = array_reverse( $teams, true );
} }
$teams_output = ''; $teams_output = '';
@@ -282,9 +283,9 @@ $identifier = uniqid( 'eventlist_' );
endif; endif;
if ( $link_teams ) : if ( $link_teams ) :
$team_output = '<a href="' . get_post_permalink( $team ) . '" itemprop="url">' . $name . '</a>'; $team_output = '<span class="team-'.$t .'"><a href="' . get_post_permalink( $team ) . '" itemprop="url">' . $name . '</a></span>';
else : else :
$team_output = $name; $team_output = '<span class="team-'.$t .'">'.$name.'</span>';
endif; endif;
$team_result = sp_array_value( $main_results, $team, null ); $team_result = sp_array_value( $main_results, $team, null );