Compare commits
10 Commits
64036ba0ae
...
91b572ab75
| Author | SHA1 | Date | |
|---|---|---|---|
|
91b572ab75
|
|||
|
8fb86314eb
|
|||
|
|
6b02e867ba | ||
|
|
9a2af2e387 | ||
|
|
a085ce0920 | ||
|
|
3cb5d2a679 | ||
|
|
3ea7cb6a4e | ||
|
|
eb444db5b8 | ||
|
|
16b0a3e3a1 | ||
|
|
719712d3d7 |
@@ -1,5 +1,11 @@
|
||||
== 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 =
|
||||
* Update - WP version tested up to 6.1.
|
||||
* Update - Leaflet version to 1.8.0.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Admin
|
||||
* @package SportsPress/Admin
|
||||
* @version 2.7.13
|
||||
* @version 2.7.17
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
@@ -19,6 +19,11 @@ if ( ! class_exists( 'SP_Admin_Permalink_Settings' ) ) :
|
||||
*/
|
||||
class SP_Admin_Permalink_Settings {
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $slugs = array();
|
||||
|
||||
/**
|
||||
* Hook in tabs.
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,9 @@ if ( ! class_exists( 'SP_Install' ) ) :
|
||||
* Hook in tabs.
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( ! defined( 'SP_PLUGIN_FILE' ) ) {
|
||||
define( 'SP_PLUGIN_FILE', __FILE__ );
|
||||
}
|
||||
register_activation_hook( SP_PLUGIN_FILE, array( $this, 'install' ) );
|
||||
|
||||
if ( defined( 'SP_PRO_PLUGIN_FILE' ) ) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* The SportsPress league table class handles individual league table data.
|
||||
*
|
||||
* @class SP_League_Table
|
||||
* @version 2.7.9
|
||||
* @version 2.7.17
|
||||
* @package SportsPress/Classes
|
||||
* @category Class
|
||||
* @author ThemeBoy
|
||||
@@ -27,6 +27,7 @@ class SP_League_Table extends SP_Secondary_Post {
|
||||
// ** @var strings
|
||||
public $orderby;
|
||||
public $orderbyorder;
|
||||
public $compare;
|
||||
|
||||
/** @var int 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
|
||||
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 ]['eventminutes'] += $minutes;
|
||||
$totals[ $team_id ]['eventminutes'] = (int) $totals[ $team_id ]['eventminutes'] + $minutes;
|
||||
$totals[ $team_id ][ $outcome ] ++;
|
||||
|
||||
// Add to home or away stats
|
||||
if ( 0 === $i ) :
|
||||
$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' ] ++;
|
||||
else :
|
||||
$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' ] ++;
|
||||
endif;
|
||||
|
||||
// Add to venue stats
|
||||
if ( sp_is_home_venue( $team_id, $event->ID ) ) :
|
||||
$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' ] ++;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Core
|
||||
* @package SportsPress/Functions
|
||||
* @version 2.7.15
|
||||
* @version 2.7.17
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
@@ -846,7 +846,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
|
||||
'hide_empty' => false,
|
||||
'values' => 'slug',
|
||||
'class' => null,
|
||||
'property' => null,
|
||||
'property' => 'none',
|
||||
'placeholder' => null,
|
||||
'chosen' => false,
|
||||
'parent' => 0,
|
||||
@@ -885,7 +885,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
|
||||
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
|
||||
|
||||
if ( strpos( $property, 'multiple' ) === false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) === false ) :
|
||||
if ( $args['show_option_blank'] ) :
|
||||
echo '<option value="">' . ( is_bool( $args['show_option_blank'] ) ? '' : esc_attr( $args['show_option_blank'] ) ) . '</option>';
|
||||
endif;
|
||||
@@ -898,7 +898,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
|
||||
endif;
|
||||
|
||||
if ( $args['show_option_auto'] ) :
|
||||
if ( strpos( $property, 'multiple' ) !== false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) !== false ) :
|
||||
$selected_prop = in_array( 'auto', $selected ) ? 'selected' : '';
|
||||
else :
|
||||
$selected_prop = selected( 'auto', $selected, false );
|
||||
@@ -914,7 +914,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
|
||||
$this_value = $term->slug;
|
||||
endif;
|
||||
|
||||
if ( strpos( $property, 'multiple' ) !== false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) !== false ) :
|
||||
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
|
||||
else :
|
||||
$selected_prop = selected( $this_value, $selected, false );
|
||||
@@ -934,7 +934,7 @@ if ( ! function_exists( 'sp_dropdown_taxonomies' ) ) {
|
||||
$this_value = $term_child->slug;
|
||||
endif;
|
||||
|
||||
if ( strpos( $property, 'multiple' ) !== false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) !== false ) :
|
||||
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
|
||||
else :
|
||||
$selected_prop = selected( $this_value, $selected, false );
|
||||
@@ -982,7 +982,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
|
||||
'post_status' => 'publish',
|
||||
'values' => 'post_name',
|
||||
'class' => null,
|
||||
'property' => null,
|
||||
'property' => 'none',
|
||||
'placeholder' => null,
|
||||
'chosen' => false,
|
||||
'filter' => false,
|
||||
@@ -1020,7 +1020,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
|
||||
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
|
||||
|
||||
if ( strpos( $property, 'multiple' ) === false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) === false ) :
|
||||
if ( $args['show_option_blank'] ) :
|
||||
printf( '<option value=""></option>' );
|
||||
endif;
|
||||
@@ -1046,7 +1046,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
|
||||
$this_value = $post->post_name;
|
||||
endif;
|
||||
|
||||
if ( strpos( $property, 'multiple' ) !== false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) !== false ) :
|
||||
$selected_prop = in_array( $this_value, $selected ) ? 'selected' : '';
|
||||
else :
|
||||
$selected_prop = selected( $this_value, $selected, false );
|
||||
@@ -1066,7 +1066,7 @@ if ( ! function_exists( 'sp_dropdown_pages' ) ) {
|
||||
endforeach;
|
||||
wp_reset_postdata();
|
||||
|
||||
if ( strpos( $property, 'multiple' ) === false ) :
|
||||
if ( $property && strpos( $property, 'multiple' ) === false ) :
|
||||
if ( $args['append_options'] && is_array( $args['append_options'] ) ) :
|
||||
foreach ( $args['append_options'] as $slug => $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['order'] = 'ASC';
|
||||
endif;
|
||||
// Add a hook to alter $query args.
|
||||
$query = apply_filters( 'sportspress_sp_post_checklist_args', $query, $meta );
|
||||
$posts = get_posts( $query );
|
||||
endif;
|
||||
foreach ( $posts as $post ) :
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @author ThemeBoy
|
||||
* @category Modules
|
||||
* @package SportsPress/Modules
|
||||
* @version 2.7.9
|
||||
* @version 2.7.17
|
||||
*/
|
||||
|
||||
// Exit if accessed directly
|
||||
@@ -19,7 +19,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
|
||||
* Main SportsPress Next Team Preset Class
|
||||
*
|
||||
* @class SportsPress_Next_Team_Preset
|
||||
* @version 2.6.3
|
||||
* @version 2.7.17
|
||||
*/
|
||||
|
||||
class SportsPress_Next_Team_Preset {
|
||||
@@ -49,7 +49,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
|
||||
*/
|
||||
private function define_constants() {
|
||||
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' ) ) {
|
||||
@@ -104,7 +104,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
|
||||
);
|
||||
|
||||
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 ) ) {
|
||||
$league_ids = array();
|
||||
}
|
||||
@@ -113,7 +113,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
|
||||
$league_ids[] = $league->term_id;
|
||||
endforeach;
|
||||
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 ) ) {
|
||||
$args['tax_query'][] = array(
|
||||
|
||||
10
readme.txt
10
readme.txt
@@ -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
|
||||
Donate link: http://tboy.co/donate
|
||||
Requires at least: 3.8
|
||||
Tested up to: 6.1
|
||||
Stable tag: 2.7.16
|
||||
Tested up to: 6.4
|
||||
Stable tag: 2.7.17
|
||||
License: GPLv3
|
||||
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 ==
|
||||
|
||||
= 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 =
|
||||
* Update - WP version tested up to 6.1.
|
||||
* Update - Leaflet version to 1.8.0.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: SportsPress
|
||||
* Plugin Name: Tony's SportsPress
|
||||
* Plugin URI: http://themeboy.com/sportspress/
|
||||
* 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 URI: http://themeboy.com
|
||||
* Requires at least: 3.8
|
||||
@@ -12,9 +12,9 @@
|
||||
* Text Domain: sportspress
|
||||
* Domain Path: /languages/
|
||||
*
|
||||
* @package SportsPress
|
||||
* @package TonysSportsPress
|
||||
* @category Core
|
||||
* @author ThemeBoy
|
||||
* @author Tony
|
||||
*/
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly
|
||||
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
|
||||
* Main SportsPress Class
|
||||
*
|
||||
* @class SportsPress
|
||||
* @version 2.7.16
|
||||
* @version 2.7.17
|
||||
*/
|
||||
final class SportsPress {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $version = '2.7.16';
|
||||
public $version = '2.7.17';
|
||||
|
||||
/**
|
||||
* @var SportsPress The single instance of the class
|
||||
@@ -60,6 +60,11 @@ if ( ! class_exists( 'SportsPress' ) ) :
|
||||
* @var SP_Templates $templates
|
||||
*/
|
||||
public $templates = null;
|
||||
|
||||
/**
|
||||
* @var SP_Feeds $feeds
|
||||
*/
|
||||
public $feeds = null;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
|
||||
@@ -253,6 +253,7 @@ $identifier = uniqid( 'eventlist_' );
|
||||
$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
|
||||
if ( $reverse_teams ) {
|
||||
$main_results = array_reverse( $main_results, true );
|
||||
$teams = array_reverse( $teams, true );
|
||||
}
|
||||
|
||||
$teams_output = '';
|
||||
@@ -282,9 +283,9 @@ $identifier = uniqid( 'eventlist_' );
|
||||
endif;
|
||||
|
||||
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 :
|
||||
$team_output = $name;
|
||||
$team_output = '<span class="team-'.$t .'">'.$name.'</span>';
|
||||
endif;
|
||||
|
||||
$team_result = sp_array_value( $main_results, $team, null );
|
||||
|
||||
Reference in New Issue
Block a user