plugin = 'sportspress/sportspress.php'; add_action( 'admin_menu', array( $this, 'admin_menus') ); add_action( 'admin_head', array( $this, 'admin_head' ) ); add_action( 'admin_init', array( $this, 'welcome' ) ); } /** * Add admin menus/screens * * @access public * @return void */ public function admin_menus() { if ( empty( $_GET['page'] ) ) { return; } $welcome_page_name = __( 'About SportsPress', 'sportspress' ); $welcome_page_title = __( 'Welcome to SportsPress', 'sportspress' ); switch ( $_GET['page'] ) { case 'sp-about' : $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-about', array( $this, 'about_screen' ) ); add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) ); break; case 'sp-credits' : $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-credits', array( $this, 'credits_screen' ) ); add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) ); break; case 'sp-translators' : $page = add_dashboard_page( $welcome_page_title, $welcome_page_name, 'manage_options', 'sp-translators', array( $this, 'translators_screen' ) ); add_action( 'admin_print_styles-'. $page, array( $this, 'admin_css' ) ); break; } } /** * admin_css function. * * @access public * @return void */ public function admin_css() { wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ), array(), SP_VERSION ); } /** * Add styles just for this page, and remove dashboard page links. * * @access public * @return void */ public function admin_head() { remove_submenu_page( 'index.php', 'sp-about' ); remove_submenu_page( 'index.php', 'sp-credits' ); remove_submenu_page( 'index.php', 'sp-translators' ); } /** * Into text/links shown on all about pages. * * @access private * @return void */ private function intro() { // Flush after upgrades if ( ! empty( $_GET['sp-updated'] ) || ! empty( $_GET['sp-installed'] ) ) flush_rewrite_rules(); // Get major version number $version = explode( '.', SP()->version, 3 ); unset( $version[2] ); $display_version = implode( '.', $version ); ?>

' ); ?>

version ); ?>

Tweet

intro(); ?>

New Frontend Stylesheet

Templates

Templates

An optional default stylesheet has been added to enhance the design of SportsPress template elements in third-party themes.

Widgets

Widgets

All related content including widgets can be styled instantly by enabling Frontend Styles in General Options.


More Advanced Statistics

Chronological Streaks

Chronological Streaks

A new Form 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.

Head to Head Tiebreakers

Head to Head Tiebreakers

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.

Time Format

Time Format

A new Time format has been added to player performance settings. Times are saved as minutes, and displayed using time format with 0:00 as the default.


Bulk Actions

Generate Team Calendars

Generate Team Calendars

Bulk actions has been added to instantly generate team calendars. Simply select the checkboxes next to each team, then choose Generate Calendars from the Bulk Actions dropdown and voilà!

Assign Teams to Players

Assign Teams to Players

Quickly add players to teams using the Bulk Edit feature. New sections have been added to select the current teams and past teams for multiple players at once.


Admin Improvements

Player List Limits

A limit option has been added to player lists when automatically adding players, enabling speedier queries.

Mixed Statistic Columns

The order of player performance and statistics can now be mixed together by editing the order of each variable.

Explicit Team URL Redirect

Decide whether to use native team pages or to redirect teams to their external URLs using the new Redirect option.

Quick Edit Players

In addition to editing the teams a player belongs to, squad numbers can also be updated via the Quick Edit menu

Independent Timed Option

Choose which values in the box score need minutes recorded, with an independent setting for each column.

Taxonomies in REST API

New endpoints have been added for taxonomies including seasons, competitions, venues, positions, and jobs.


Under the Hood

Variables Filtered by Offense and Defense

Offense and defense statistics are now calculated using only the player performance from the same category.

Account for Substitution Time

The Minutes equation variable is now automatically adjusted by subtracting substitution time.

Division by Zero

No more errors when dividing by zero. Equations with undefined solutions now simply return zero for that value.

'sportspress_sport', 'default' => get_option( 'sportspress_sport', 'custom' ), 'type' => 'sport', 'title' => __( 'Sport', 'sportspress' ), 'welcome' => true, 'class' => $class, 'options' => $sport_options, ), ); SP_Admin_Settings::output_fields( $settings ); ?>

intro(); ?>

Contribute to SportsPress.', 'sportspress' ), 'https://github.com/ThemeBoy/SportsPress/blob/master/CONTRIBUTING.md' ); ?>

contributors(); ?>

Add a Sport Preset.', 'sportspress' ), 'http://tboy.co/preset' ); ?>

'Oscar Wong', __( 'Lacrosse', 'sportspress' ) => 'Jamie', ); ?>
$name ) { ?>
intro(); ?>

Translate SportsPress.', 'sportspress' ), 'https://www.transifex.com/projects/p/sportspress/' ); ?>

array( 'albpower', ), 'العربية' => array( 'Abdulelah', 'elgolden', 'hushiea', ), 'Հայերեն' => array( 'ArtakEVN', ), 'বাংলা' => array( 'alisiddique', ), 'Bosanski' => array( 'etcloki', ), 'Български' => array( 'alltimecams', 'den_zlateva', ), '简体中文' => array( 'dic_2008', 'mobking', ), '繁體中文' => array( 'wah826', ), 'Hrvatski' => array( 'etcloki', 'i__k', 'iojvan', 'vlinicx', ), 'Čeština' => array( 'eifelstudio', 'thegreat', ), 'Nederlands' => array( 'demoyer', 'paulcoppen', 'poelie', 'SilverXp', 'valentijnreza', ), 'Suomi' => array( 'hanro', 'Hermanni', 'JuKi', 'Taurus', ), 'Français' => array( 'francois53', 'fredodq', 'HuguesD', 'MohamedZ', 'wolforg', ), 'Deutsch' => array( 'alexander.salomon99', 'Bhelpful2', 'chr86', 'deckerweb', 'denkuhn', 'FollowCandyPanda', 'green_big_frog', 'King3R', 'Tandor', 'tkausch', ), 'Ελληνικά' => array( 'filippos.sdr', 'Spirossmil', ), 'Íslenska' => array( 'ValliFudd', ), 'Italiano' => array( 'eNnvi', 'Flubber89', 'GhiMax', 'joegalaxy66', 'massimo.marra', 'sododesign', 'violaud', 'webby1973', 'xFrAx', ), '日本語' => array( 'aylaview', ), '한국어' => array( 'jikji96', ), 'Македонски' => array( 'doncer', ), 'Norsk bokmål' => array( 'jenymoen', 'Laislebai', 'm4rsal', 'sijo', 'slappfiskene.no', 'vetsmi', ), 'فارسی' => array( 'mahdi12', ), 'Polski' => array( 'Elmister', 'karimjarro', 'krisop', ), 'Português do Brasil' => array( 'AugustoNeto', 'Ferenan', 'lfrodines', 'Ozias', 'pgbenini', 'rochester', ), 'Português' => array( 'Andrew_Melim', 'nagashitw', ), 'Română' => array( 'GonerSTUDIO', 'tyby94', ), 'Русский' => array( 'elrawys', 'kanakoff', 'sashaCZ', 'Selskei', 'SmilyCarrot', 'zzcs', ), 'Српски језик' => array( 'etcloki', ), 'Slovenščina' => array( 'Ales70', 'BOCo', 'cofeman.sl', 'matiqos', ), 'Español' => array( 'albertone', 'diego.battistella', 'elarequi', 'EmiDelCaz', 'edesl', 'fernandori', 'GonerSTUDIO', 'i1m3a7n92', 'latixns', 'opticadeharo', 'popeosorio', ), 'Svenska' => array( 'fiiz', 'JensZ', ), 'தமிழ்' => array( 'chinnz25', ), 'Türkçe' => array( 'ALooNeBoy87', 'ceyhunulas', 'GuneshGamza95', 'muhahmetkara', 'overbite', ), 'Українська' => array( 'ViktoriaRuzhylo', ), 'Tiếng Việt' => array( 'bizover', ), 'ಕನ್ನಡ' => array( 'Paramamithra', ), 'ไทย' => array( 'Xyteton', ), ); $languages = array_keys( $translators ); shuffle( $languages ); $translation_teams = array(); foreach ( $languages as $language ): $handles = $translators[ $language ]; $team = '' . $language . ' ' . __( 'by', 'sportspress' ) . ' '; $team_members = array(); foreach ( $handles as $handle ): $team_members[] = '' . $handle . ''; endforeach; $members = implode( ', ', $team_members ); $team .= $members; $team .= ''; $translation_teams[] = $team; endforeach; echo implode( '
', $translation_teams ); ?>

get_contributors(); if ( empty( $contributors ) ) { return ''; } $contributor_list = ''; return $contributor_list; } /** * Retrieve list of contributors from GitHub. * * @access public * @return mixed */ public function get_contributors() { $contributors = get_transient( 'sportspress_contributors' ); if ( false !== $contributors ) { return $contributors; } $response = wp_remote_get( 'https://api.github.com/repos/ThemeBoy/SportsPress/contributors', array( 'sslverify' => false ) ); if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { return array(); } $contributors = json_decode( wp_remote_retrieve_body( $response ) ); if ( ! is_array( $contributors ) ) { return array(); } set_transient( 'sportspress_contributors', $contributors, HOUR_IN_SECONDS ); return $contributors; } /** * Sends user to the welcome page on first activation */ public function welcome() { // Bail if no activation redirect transient is set if ( ! get_transient( '_sp_activation_redirect' ) ) return; // Delete the redirect transient delete_transient( '_sp_activation_redirect' ); // Bail if we are waiting to install or update via the interface update/install links if ( get_option( '_sp_needs_update' ) == 1 || get_option( '_sp_needs_pages' ) == 1 ) return; // Bail if activating from network, or bulk, or within an iFrame if ( is_network_admin() || isset( $_GET['activate-multi'] ) || defined( 'IFRAME_REQUEST' ) ) return; if ( ( isset( $_GET['action'] ) && 'upgrade-plugin' == $_GET['action'] ) && ( isset( $_GET['plugin'] ) && strstr( $_GET['plugin'], 'sportspress.php' ) ) ) return; wp_redirect( admin_url( 'index.php?page=sp-about' ) ); exit; } } new SP_Admin_Welcome();