Compare commits

..

11 Commits

Author SHA1 Message Date
ccc6c1877d add home and away labels in post edit 2024-01-20 16:10:56 -06:00
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
10 changed files with 75 additions and 31 deletions

View File

@@ -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.

View File

@@ -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.
*/

View File

@@ -29,6 +29,21 @@ class SP_Meta_Box_Event_Teams {
$team = array_shift( $teams );
?>
<div class="sp-instance">
<p>
<strong>
<?php
if ($i==0){
echo esc_attr__("Home");
}
elseif ($i==1){
echo esc_attr__("Away");
}
else {
echo esc_attr__("Team") . " " . ($i +1);
}
?>
</strong>
</p>
<p class="sp-tab-select sp-title-generator">
<?php
$args = array(

View File

@@ -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' ) ) {

View 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;

View File

@@ -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 ) :

View File

@@ -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(

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
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.

View File

@@ -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

View File

@@ -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 );