Plugin Directory

Changeset 2099652


Ignore:
Timestamp:
06/03/2019 07:57:56 AM (7 years ago)
Author:
brianmiyaji
Message:

updating tested version

Location:
sportspress-for-golf
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sportspress-for-golf/tags/0.9.1/license.txt

    r1619089 r2099652  
    11SportsPress for Golf
    22
    3 Copyright 2017 by ThemeBoy
     3Copyright 2019 by ThemeBoy
    44
    55This program is free software; you can redistribute it and/or modify
  • sportspress-for-golf/tags/0.9.1/readme.txt

    r1765931 r2099652  
    44Donate link: http://tboy.co/donate
    55Requires at least: 3.8
    6 Tested up to: 4.9
     6Tested up to: 5.2
    77Stable tag: 0.9.1
    88License: GPLv3
  • sportspress-for-golf/tags/0.9.1/sportspress-for-golf.php

    r1619089 r2099652  
    4343        add_filter( 'sportspress_equation_options', array( $this, 'equation_options' ) );
    4444        add_filter( 'sportspress_event_result_equation_vars', array( $this, 'equation_vars' ), 10, 3 );
     45
     46        // Format results to reflect if over or under par
     47        add_filter( 'sportspress_event_results', array( $this, 'results' ), 10, 4 );
    4548
    4649        // Add number of holes to event meta box
     
    281284    }
    282285
     286    /**
     287     * Format results to reflect if over or under par.
     288    */
     289    public function results( $results = array(), $id = 0 ) {
     290        foreach ( $results as $team_id => $team_results ) {
     291            if ( ! is_array( $team_results ) ) continue;
     292            if ( ! $team_id ) continue;
     293            foreach ( $team_results as $key => $value ) {
     294                if ( 'par' !== $key ) continue;
     295                $results[ $team_id ][ $key ] = sprintf( "%+d", $value );
     296            }
     297        }
     298        return $results;
     299    }
     300
    283301    /**
    284302     * Text filter.
  • sportspress-for-golf/trunk/license.txt

    r1619089 r2099652  
    11SportsPress for Golf
    22
    3 Copyright 2017 by ThemeBoy
     3Copyright 2019 by ThemeBoy
    44
    55This program is free software; you can redistribute it and/or modify
  • sportspress-for-golf/trunk/readme.txt

    r1765931 r2099652  
    44Donate link: http://tboy.co/donate
    55Requires at least: 3.8
    6 Tested up to: 4.9
     6Tested up to: 5.2
    77Stable tag: 0.9.1
    88License: GPLv3
  • sportspress-for-golf/trunk/sportspress-for-golf.php

    r1619089 r2099652  
    4343        add_filter( 'sportspress_equation_options', array( $this, 'equation_options' ) );
    4444        add_filter( 'sportspress_event_result_equation_vars', array( $this, 'equation_vars' ), 10, 3 );
     45
     46        // Format results to reflect if over or under par
     47        add_filter( 'sportspress_event_results', array( $this, 'results' ), 10, 4 );
    4548
    4649        // Add number of holes to event meta box
     
    281284    }
    282285
     286    /**
     287     * Format results to reflect if over or under par.
     288    */
     289    public function results( $results = array(), $id = 0 ) {
     290        foreach ( $results as $team_id => $team_results ) {
     291            if ( ! is_array( $team_results ) ) continue;
     292            if ( ! $team_id ) continue;
     293            foreach ( $team_results as $key => $value ) {
     294                if ( 'par' !== $key ) continue;
     295                $results[ $team_id ][ $key ] = sprintf( "%+d", $value );
     296            }
     297        }
     298        return $results;
     299    }
     300
    283301    /**
    284302     * Text filter.
Note: See TracChangeset for help on using the changeset viewer.