From 8fad5481a0f1b07f487ffb5d1b4b81221b16b37b Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 26 Jan 2018 01:34:03 +1100 Subject: [PATCH] Turn off responsive tables by default --- includes/admin/settings/class-sp-settings-general.php | 2 +- includes/class-sp-install.php | 4 ++++ templates/event-list.php | 2 +- templates/event-performance-table.php | 2 +- templates/league-table.php | 2 +- templates/player-list.php | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/admin/settings/class-sp-settings-general.php b/includes/admin/settings/class-sp-settings-general.php index 5e4f3284..5507342a 100644 --- a/includes/admin/settings/class-sp-settings-general.php +++ b/includes/admin/settings/class-sp-settings-general.php @@ -176,7 +176,7 @@ class SP_Settings_General extends SP_Settings_Page { 'title' => __( 'Tables', 'sportspress' ), 'desc' => __( 'Responsive', 'sportspress' ), 'id' => 'sportspress_enable_responsive_tables', - 'default' => 'yes', + 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'start', ), diff --git a/includes/class-sp-install.php b/includes/class-sp-install.php index a65dfe8f..f7ade471 100644 --- a/includes/class-sp-install.php +++ b/includes/class-sp-install.php @@ -432,6 +432,10 @@ class SP_Install { update_option( 'sportspress_mode', 'team' ); } } + + if ( version_compare( $version, '2.5.5', '<' ) ) { + update_option( 'sportspress_enable_responsive_tables', 'no' ); + } } /** diff --git a/templates/event-list.php b/templates/event-list.php index 124cf490..db589462 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -31,7 +31,7 @@ $defaults = array( 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'link_venues' => get_option( 'sportspress_link_venues', 'yes' ) == 'yes' ? true : false, 'abbreviate_teams' => get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false, - 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, + 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_event_list_paginated', 'yes' ) == 'yes' ? true : false, diff --git a/templates/event-performance-table.php b/templates/event-performance-table.php index 1c239e6b..75f970b9 100644 --- a/templates/event-performance-table.php +++ b/templates/event-performance-table.php @@ -21,7 +21,7 @@ if ( ! isset( $class ) ) $class = null; if ( ! isset( $lineups ) ) $lineups = array(); if ( ! isset( $subs ) ) $subs = array(); -$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false; +$responsive = get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false; //Create a unique identifier based on the current time in microseconds $identifier = uniqid( 'performance_' ); // If responsive tables are enabled then load the inline css code diff --git a/templates/league-table.php b/templates/league-table.php index de0ca90b..410c9a1e 100644 --- a/templates/league-table.php +++ b/templates/league-table.php @@ -19,7 +19,7 @@ $defaults = array( 'show_title' => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false, 'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false, 'link_posts' => null, - 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, + 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false, diff --git a/templates/player-list.php b/templates/player-list.php index 60f1455d..bc59425a 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -25,7 +25,7 @@ $defaults = array( 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'abbreviate_teams' => get_option( 'sportspress_abbreviate_teams', 'yes' ) === 'yes' ? true : false, - 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false, + 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, 'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false, 'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false, 'paginated' => get_option( 'sportspress_list_paginated', 'yes' ) == 'yes' ? true : false,