Skip to content

Commit

Permalink
Update core
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmiyaji committed Mar 22, 2017
1 parent ab121fe commit d217344
Show file tree
Hide file tree
Showing 51 changed files with 135 additions and 344 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion includes/sportspress/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
* Feature - Add squad number and name option to player details.
* Feature - Add tab options to layout designer.
* Feature - Add option to display player and staff dropdowns in profiles.
* Feature - Add option to select TBA, postponed, and cancelled event status.
* Feature - Add option to select TBA, postponed, and canceled event status.
* Feature - Licenses tab for third-party extensions.
* Tweak - Get player data only when needed.
* Tweak - Add capabilities to taxonomies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 2.1
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* The SportsPress admin sample data class stores demo content.
*
* @class SP_Admin_Sample_Data
* @version 1.9
* @version 2.3
* @package SportsPress/Admin
* @category Class
* @author ThemeBoy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 2.2
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down Expand Up @@ -442,8 +442,9 @@ class="chosen-select<?php if ( is_rtl() ): ?> chosen-rtl<?php endif; ?> <?php ec
// Select sport
case 'sport' :

$default = apply_filters( 'sportspress_default_sport', 'soccer' );
$option_value = self::get_option( $value['id'], $value['default'] );
if ( 'none' === $option_value ) $option_value = 'soccer';
if ( 'none' === $option_value ) $option_value = $default;

$categories = SP_Admin_Sports::sport_category_names();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author WooThemes
* @category Admin
* @package SportsPress/Admin
* @version 2.6.0
* @version 2.3
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down Expand Up @@ -255,8 +255,9 @@ public function sp_setup_basics() {
<td>
<?php
$options = SP_Admin_Sports::get_preset_options();
$default = get_option( 'sportspress_sport', 'soccer' );
if ( 'none' === $default ) $default = 'soccer';
$default = apply_filters( 'sportspress_default_sport', 'soccer' );
$sport = get_option( 'sportspress_sport', $default );
if ( 'none' === $sport ) $sport = $default;
$categories = SP_Admin_Sports::sport_category_names();
?>
<select name="sport" id="sport" class="sp-select-sport <?php echo esc_attr( $class ); ?>">
Expand All @@ -267,7 +268,7 @@ public function sp_setup_basics() {
<?php
foreach ( $options as $key => $val ) {
?>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $default, $key ); ?>><?php echo $val ?></option>
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $sport, $key ); ?>><?php echo $val ?></option>
<?php
}
?>
Expand Down Expand Up @@ -409,7 +410,7 @@ public function sp_setup_teams_save() {
* Players & Staff Setup.
*/
public function sp_setup_players_staff() {
$positions = get_terms( 'sp_position', array( 'hide_empty' => 0, 'orderby' => 'slug', 'fields' => 'names' ) )
$positions = (array) get_terms( 'sp_position', array( 'hide_empty' => 0, 'orderby' => 'slug', 'fields' => 'names' ) )
?>
<h1><?php esc_html_e( 'Player & Staff Setup', 'sportspress' ); ?></h1>
<form method="post">
Expand Down Expand Up @@ -564,7 +565,9 @@ public function sp_setup_venue_save() {
if ( ! is_wp_error( $inserted ) ) {
$t_id = sp_array_value( $inserted, 'term_id', 1 );

wp_set_object_terms( $team, $t_id, 'sp_venue', true );
if ( $team ) {
wp_set_object_terms( $team, $t_id, 'sp_venue', true );
}

$meta = array(
'sp_address' => sp_array_value( $_POST, 'address' ),
Expand Down Expand Up @@ -686,7 +689,11 @@ private function sp_setup_ready_actions() {
}

// Get teams
$teams = get_posts( array( 'posts_per_page' => 2, 'post_type' => 'sp_team' ) );
$team_post_type = 'sp_team';
if ( 'player' === get_option( 'sportspress_mode', 'team' ) ) {
$team_post_type = 'sp_player';
}
$teams = get_posts( array( 'posts_per_page' => 2, 'post_type' => $team_post_type ) );

// Get players
$players = (array) get_posts( array( 'posts_per_page' => 3, 'post_type' => 'sp_player', 'fields' => 'ids' ) );
Expand Down
114 changes: 37 additions & 77 deletions includes/sportspress/includes/admin/class-sp-admin-welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 2.2.10
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down Expand Up @@ -176,94 +176,54 @@ public function about_screen() {

do_action( 'sportspress_before_welcome_features' );
?>

<?php if ( ! current_theme_supports( 'sportspress' ) ) { ?>

<div class="feature-section two-col">
<h2>New Frontend Stylesheet</h2>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/player-profile-style.jpg" alt="Templates">
<h3>Templates</h3>
<p>An optional default stylesheet has been added to enhance the design of SportsPress template elements in third-party themes.</p>
</div>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/event-blocks-style.png" alt="Widgets">
<h3>Widgets</h3>
<p>All related content including widgets can be styled instantly by enabling <strong>Frontend Styles</strong> in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'general' ), admin_url( 'admin.php' ) ); ?>">General Options</a>.</p>
</div>
<div class="feature-section two-col">
<h2>Mode Switching</h2>
<div class="col">
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-team-vs-team.png" alt="Team vs Team">
<h3>Team vs Team</h3>
<p>Switch between team and individual mode per event. By default, events are held between teams with multiple players on each side.</p>
</div>
<div class="col">
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-player-vs-player.png" alt="Player vs Player">
<h3>Player vs Player</h3>
<p>Select this mode to remove team selectors in events. Instead, players compete with each other. Select a default mode in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'events' ), admin_url( 'admin.php' ) ); ?>">Event Options</a>.</p>
</div>
</div>

<hr>

<?php } ?>
<hr>

<div class="feature-section three-col">
<h2>More Advanced Statistics</h2>
<h2>Time-Saving Features</h2>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/chronological-streaks.png" alt="Chronological Streaks">
<h3>Chronological Streaks</h3>
<p>A new <strong>Form</strong> preset variable has been added to the equation builder for table columns. Use this variable to display the most recent outcomes with each outcome linking to that event.</p>
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-user-registration.png" alt="User Registration">
<h3>User Registration</h3>
<p>Automatically create player profiles for new users by enabling <strong>User Registration</strong> in <a href="<?php echo add_query_arg( array( 'page' => 'sportspress', 'tab' => 'players' ), admin_url( 'admin.php' ) ); ?>">Player Options</a> and <strong>Membership</strong> in <a href="<?php echo admin_url( 'options-general.php' ); ?>">General Settings</a>.</p>
</div>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/tiebreaker-setting.gif" alt="Head to Head Tiebreakers">
<h3>Head to Head Tiebreakers</h3>
<p>When two or more teams are tied in the general standings, SportsPress can now automatically analyze the events between those teams to determine who comes out on top.</p>
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-setup-wizard.png" alt="Setup Wizard">
<h3>Setup Wizard</h3>
<p>A guided <a href="<?php echo add_query_arg( array( 'page' => 'sp-setup' ), admin_url( 'admin.php' ) ); ?>">Setup Wizard</a> can help you get started by adding basic details, teams, players, staff, venues, and your first event.</p>
</div>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/time-format.png" alt="Time Format">
<h3>Time Format</h3>
<p>A new <strong>Time</strong> format has been added to player performance settings. Times are saved as minutes, and displayed using time format with <em>0:00</em> as the default.</p>
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-send-offs.png" alt="Send Offs">
<h3>Send Offs</h3>
<p>A new <strong>Send Off</strong> option has been added to player performance settings, limiting the played minutes for sent off players.</p>
</div>
</div>

<hr>

<div class="feature-section two-col">
<h2>Bulk Actions</h2>
<h2>New in SportsPress Pro</h2>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/bulk-team-calendars.gif" alt="Generate Team Calendars">
<h3>Generate Team Calendars</h3>
<p>Bulk actions has been added to instantly generate team calendars. Simply select the checkboxes next to each team, then choose <strong>Generate Calendars</strong> from the <strong>Bulk Actions</strong> dropdown and voilà!</p>
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-user-scores-frontend.png" alt="Frontend Submissions">
<h3>Frontend Submissions</h3>
<p>Display a frontend section for logged in players to submit their own scores. Optionally, registered staff and team managers can also submit scores for their entire team.</p>
</div>
<div class="col">
<img src="https://www.themeboy.com/wp-content/uploads/bulk-player-teams.png" alt="Assign Teams to Players">
<h3>Assign Teams to Players</h3>
<p>Quickly add players to teams using the <strong>Bulk Edit</strong> feature. New sections have been added to select the current teams and past teams for multiple players at once.</p>
</div>
</div>

<hr />

<div class="changelog">
<h2>Admin Improvements</h2>
<div class="under-the-hood three-col">
<div class="col">
<h3>Player List Limits</h3>
<p>A limit option has been added to player lists when automatically adding players, enabling speedier queries.</p>
</div>
<div class="col">
<h3>Mixed Statistic Columns</h3>
<p>The order of player performance and statistics can now be mixed together by editing the order of each variable.</p>
</div>
<div class="col">
<h3>Explicit Team URL Redirect</h3>
<p>Decide whether to use native team pages or to redirect teams to their external URLs using the new <strong>Redirect</strong> option.</p>
</div>
</div>

<div class="under-the-hood three-col">
<div class="col">
<h3>Quick Edit Players</h3>
<p>In addition to editing the teams a player belongs to, squad numbers can also be updated via the <strong>Quick Edit</strong> menu</p>
</div>
<div class="col">
<h3>Independent Timed Option</h3>
<p>Choose which values in the box score need minutes recorded, with an independent setting for each column.</p>
</div>
<div class="col">
<h3>Taxonomies in REST API</h3>
<p>New endpoints have been added for taxonomies including seasons, competitions, venues, positions, and jobs.</p>
</div>
<img src="<?php echo plugin_dir_url( SP_PLUGIN_FILE ); ?>assets/images/welcome/screenshot-user-scores-admin.png" alt="Admin Approval">
<h3>Admin Approval</h3>
<p>Once the scores are received, the owner of the event or an admin user can approve or reject each submission. Logged in users can amend their submissions at any time. Only approved scores are published.</p>
</div>
</div>

Expand All @@ -273,16 +233,16 @@ public function about_screen() {
<h2>Under the Hood</h2>
<div class="under-the-hood three-col">
<div class="col">
<h3>Variables Filtered by Offense and Defense</h3>
<p>Offense and defense statistics are now calculated using only the player performance from the same category.</p>
<h3>Loading Borrowed Players</h3>
<p>Players borrowed from other teams are now automatically loaded when editing events in the dashboard.</p>
</div>
<div class="col">
<h3>Account for Substitution Time</h3>
<p>The <strong>Minutes</strong> equation variable is now automatically adjusted by subtracting substitution time.</p>
<h3>Frontend Style Overrides</h3>
<p>Text colors have been adjusted to improve readability when using color schemes with dark backgrounds and light text.</p>
</div>
<div class="col">
<h3>Division by Zero</h3>
<p>No more errors when dividing by zero. Equations with undefined solutions now simply return zero for that value.</p>
<h3>Shared Box Score Template</h3>
<p>The templates used for rendering team and individual box scores have been combined into a single template.</p>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion includes/sportspress/includes/admin/class-sp-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 2.2
* @version 2.3
*/
class SP_Admin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.1.6
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.2.4
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.2.11
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.2.4
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.9.7
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.1
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.9.13
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.2
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.2
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.9.7
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.8.9
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 2.2
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
* @version 1.9.8
* @version 2.3
*/

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
Expand Down
Loading

0 comments on commit d217344

Please sign in to comment.