Plugin Directory

Changeset 2319513


Ignore:
Timestamp:
06/06/2020 03:02:25 PM (6 years ago)
Author:
ThemeBoy
Message:

tagging version 2.7.2

Location:
sportspress
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sportspress/tags/2.7.2/changelog.txt

    r2280658 r2319513  
    11== SportsPress Changelog ==
     2
     3= 2.7.2 =
     4* Tweak - Sanitize delimiter field in event settings.
    25
    36= 2.7.1 =
  • sportspress/tags/2.7.2/includes/admin/settings/class-sp-settings-events.php

    r2097227 r2319513  
    66 * @category    Admin
    77 * @package     SportsPress/Admin
    8  * @version     2.6.15
     8 * @version     2.7.1.2
    99 */
    1010
     
    470470       
    471471        if ( isset( $_POST['sportspress_event_teams_delimiter'] ) )
    472             update_option( 'sportspress_event_teams_delimiter', $_POST['sportspress_event_teams_delimiter'] );
     472            update_option( 'sportspress_event_teams_delimiter', sanitize_text_field( $_POST['sportspress_event_teams_delimiter'] ) );
    473473    }
    474474
  • sportspress/tags/2.7.2/includes/widgets/class-sp-widget-countdown.php

    r1986732 r2319513  
    1717        $show_league = empty($instance['show_league']) ? false : $instance['show_league'];
    1818        $show_date = empty($instance['show_date']) ? false : $instance['show_date'];
     19        $show_excluded = empty($instance['show_excluded']) ? false : $instance['show_excluded'];
    1920
    2021        do_action( 'sportspress_before_widget', $args, $instance, 'countdown' );
     
    2728        do_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' );
    2829
    29         sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date ) );
     30        sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date, 'show_excluded' => $show_excluded ) );
    3031
    3132        // Action to hook into
     
    4647        $instance['show_league'] = intval($new_instance['show_league']);
    4748        $instance['show_date'] = intval($new_instance['show_date']);
     49        $instance['show_excluded'] = intval($new_instance['show_excluded']);
    4850
    4951        // Filter to hook into
     
    5456
    5557    function form( $instance ) {
    56         $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false, 'show_date' => false ) );
     58        $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false, 'show_date' => false, 'show_excluded' => false ) );
    5759        $title = strip_tags($instance['title']);
    5860        $caption = strip_tags($instance['caption']);
     
    6365        $show_league = intval($instance['show_league']);
    6466        $show_date = intval($instance['show_date']);
     67        $show_excluded = intval($instance['show_excluded']);
    6568
    6669        // Action to hook into
     
    136139        <label for="<?php echo $this->get_field_id('show_date'); ?>"><?php _e( 'Display date', 'sportspress' ); ?></label></p>
    137140       
     141        <p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_excluded'); ?>" name="<?php echo $this->get_field_name('show_excluded'); ?>" value="1" <?php checked( $show_excluded, 1 ); ?>>
     142        <label for="<?php echo $this->get_field_id('show_excluded'); ?>"><?php _e( 'Display excluded events', 'sportspress' ); ?></label></p>
     143       
    138144        <?php
    139145        // Action to hook into
  • sportspress/tags/2.7.2/readme.txt

    r2280658 r2319513  
    55Requires at least: 3.8
    66Tested up to: 5.3
    7 Stable tag: 2.7.1
     7Stable tag: 2.7.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    240240
    241241== Changelog ==
     242
     243= 2.7.2 =
     244* Tweak - Sanitize delimiter field in event settings.
    242245
    243246= 2.7.1 =
  • sportspress/tags/2.7.2/sportspress.php

    r2280658 r2319513  
    44 * Plugin URI: http://themeboy.com/sportspress/
    55 * Description: Manage your club and its players, staff, events, league tables, and player lists.
    6  * Version: 2.7.1
     6 * Version: 2.7.2
    77 * Author: ThemeBoy
    88 * Author URI: http://themeboy.com
     
    2727 *
    2828 * @class SportsPress
    29  * @version 2.7.1
     29 * @version 2.7.2
    3030 */
    3131final class SportsPress {
     
    3434     * @var string
    3535     */
    36     public $version = '2.7.1';
     36    public $version = '2.7.2';
    3737
    3838    /**
  • sportspress/tags/2.7.2/templates/countdown.php

    r2280658 r2319513  
    2424    'show_thumbnail' => get_option( 'sportspress_countdown_show_thumbnail', 'no' ) == 'yes' ? true : false,
    2525);
     26
     27if ( isset( $show_excluded ) && $show_excluded ){
     28    $excluded_statuses = array();
     29}else{
     30    $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array(
     31        'postponed',
     32        'cancelled',
     33    ) );
     34}
     35
    2636if ( isset( $id ) ):
    2737    $post = get_post( $id );
     
    3747     * Exclude postponed or cancelled events.
    3848     */
    39     $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array(
    40         'postponed',
    41         'cancelled',
    42     ) );
    4349    while ( $post = array_shift( $data ) ) {
    4450        $sp_status = get_post_meta($post->ID, 'sp_status', true);
     
    8187        'key' => 'sp_status',
    8288        'compare' => 'NOT IN',
    83         'value' => apply_filters( 'sp_countdown_excluded_statuses', array(
    84             'postponed',
    85             'cancelled',
    86         ) ),
     89        'value' => $excluded_statuses,
    8790    ];
    8891
     
    99102$title = $post->post_title;
    100103if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false, true ) . '">' . $title . '</a>';
     104$sp_status = get_post_meta($post->ID, 'sp_status', true);
     105$statuses = apply_filters( 'sportspress_event_statuses', array(
     106            'ok' => __( 'On time', 'sportspress' ),
     107            'tbd' => __( 'TBD', 'sportspress' ),
     108            'postponed' => __( 'Postponed', 'sportspress' ),
     109            'cancelled' => __( 'Canceled', 'sportspress' ),
     110        ) );
    101111?>
    102112<div class="sp-template sp-template-countdown">
     
    129139            }
    130140            ?>
    131             <?php echo $title; ?>
     141            <?php echo $title.' ('.$statuses[ $sp_status ].')'; ?>
    132142        </h3>
    133143        <?php
  • sportspress/trunk/changelog.txt

    r2280658 r2319513  
    11== SportsPress Changelog ==
     2
     3= 2.7.2 =
     4* Tweak - Sanitize delimiter field in event settings.
    25
    36= 2.7.1 =
  • sportspress/trunk/includes/admin/settings/class-sp-settings-events.php

    r2097227 r2319513  
    66 * @category    Admin
    77 * @package     SportsPress/Admin
    8  * @version     2.6.15
     8 * @version     2.7.1.2
    99 */
    1010
     
    470470       
    471471        if ( isset( $_POST['sportspress_event_teams_delimiter'] ) )
    472             update_option( 'sportspress_event_teams_delimiter', $_POST['sportspress_event_teams_delimiter'] );
     472            update_option( 'sportspress_event_teams_delimiter', sanitize_text_field( $_POST['sportspress_event_teams_delimiter'] ) );
    473473    }
    474474
  • sportspress/trunk/includes/widgets/class-sp-widget-countdown.php

    r1986732 r2319513  
    1717        $show_league = empty($instance['show_league']) ? false : $instance['show_league'];
    1818        $show_date = empty($instance['show_date']) ? false : $instance['show_date'];
     19        $show_excluded = empty($instance['show_excluded']) ? false : $instance['show_excluded'];
    1920
    2021        do_action( 'sportspress_before_widget', $args, $instance, 'countdown' );
     
    2728        do_action( 'sportspress_before_widget_template', $args, $instance, 'countdown' );
    2829
    29         sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date ) );
     30        sp_get_template( 'countdown.php', array( 'calendar' => $calendar, 'team' => $team, 'id' => $id, 'title' => $caption, 'show_venue' => $show_venue, 'show_league' => $show_league, 'show_date' => $show_date, 'show_excluded' => $show_excluded ) );
    3031
    3132        // Action to hook into
     
    4647        $instance['show_league'] = intval($new_instance['show_league']);
    4748        $instance['show_date'] = intval($new_instance['show_date']);
     49        $instance['show_excluded'] = intval($new_instance['show_excluded']);
    4850
    4951        // Filter to hook into
     
    5456
    5557    function form( $instance ) {
    56         $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false, 'show_date' => false ) );
     58        $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false, 'show_date' => false, 'show_excluded' => false ) );
    5759        $title = strip_tags($instance['title']);
    5860        $caption = strip_tags($instance['caption']);
     
    6365        $show_league = intval($instance['show_league']);
    6466        $show_date = intval($instance['show_date']);
     67        $show_excluded = intval($instance['show_excluded']);
    6568
    6669        // Action to hook into
     
    136139        <label for="<?php echo $this->get_field_id('show_date'); ?>"><?php _e( 'Display date', 'sportspress' ); ?></label></p>
    137140       
     141        <p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_excluded'); ?>" name="<?php echo $this->get_field_name('show_excluded'); ?>" value="1" <?php checked( $show_excluded, 1 ); ?>>
     142        <label for="<?php echo $this->get_field_id('show_excluded'); ?>"><?php _e( 'Display excluded events', 'sportspress' ); ?></label></p>
     143       
    138144        <?php
    139145        // Action to hook into
  • sportspress/trunk/readme.txt

    r2280658 r2319513  
    55Requires at least: 3.8
    66Tested up to: 5.3
    7 Stable tag: 2.7.1
     7Stable tag: 2.7.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    240240
    241241== Changelog ==
     242
     243= 2.7.2 =
     244* Tweak - Sanitize delimiter field in event settings.
    242245
    243246= 2.7.1 =
  • sportspress/trunk/sportspress.php

    r2280658 r2319513  
    44 * Plugin URI: http://themeboy.com/sportspress/
    55 * Description: Manage your club and its players, staff, events, league tables, and player lists.
    6  * Version: 2.7.1
     6 * Version: 2.7.2
    77 * Author: ThemeBoy
    88 * Author URI: http://themeboy.com
     
    2727 *
    2828 * @class SportsPress
    29  * @version 2.7.1
     29 * @version 2.7.2
    3030 */
    3131final class SportsPress {
     
    3434     * @var string
    3535     */
    36     public $version = '2.7.1';
     36    public $version = '2.7.2';
    3737
    3838    /**
  • sportspress/trunk/templates/countdown.php

    r2280658 r2319513  
    2424    'show_thumbnail' => get_option( 'sportspress_countdown_show_thumbnail', 'no' ) == 'yes' ? true : false,
    2525);
     26
     27if ( isset( $show_excluded ) && $show_excluded ){
     28    $excluded_statuses = array();
     29}else{
     30    $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array(
     31        'postponed',
     32        'cancelled',
     33    ) );
     34}
     35
    2636if ( isset( $id ) ):
    2737    $post = get_post( $id );
     
    3747     * Exclude postponed or cancelled events.
    3848     */
    39     $excluded_statuses = apply_filters( 'sp_countdown_excluded_statuses', array(
    40         'postponed',
    41         'cancelled',
    42     ) );
    4349    while ( $post = array_shift( $data ) ) {
    4450        $sp_status = get_post_meta($post->ID, 'sp_status', true);
     
    8187        'key' => 'sp_status',
    8288        'compare' => 'NOT IN',
    83         'value' => apply_filters( 'sp_countdown_excluded_statuses', array(
    84             'postponed',
    85             'cancelled',
    86         ) ),
     89        'value' => $excluded_statuses,
    8790    ];
    8891
     
    99102$title = $post->post_title;
    100103if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false, true ) . '">' . $title . '</a>';
     104$sp_status = get_post_meta($post->ID, 'sp_status', true);
     105$statuses = apply_filters( 'sportspress_event_statuses', array(
     106            'ok' => __( 'On time', 'sportspress' ),
     107            'tbd' => __( 'TBD', 'sportspress' ),
     108            'postponed' => __( 'Postponed', 'sportspress' ),
     109            'cancelled' => __( 'Canceled', 'sportspress' ),
     110        ) );
    101111?>
    102112<div class="sp-template sp-template-countdown">
     
    129139            }
    130140            ?>
    131             <?php echo $title; ?>
     141            <?php echo $title.' ('.$statuses[ $sp_status ].')'; ?>
    132142        </h3>
    133143        <?php
Note: See TracChangeset for help on using the changeset viewer.