From 8c8b82d94e2bac0535c8471518217fc30fa80c29 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sun, 30 Oct 2016 20:26:28 +1100 Subject: [PATCH] Prepend dropdown templates if upgrading from previous version --- includes/class-sp-install.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/includes/class-sp-install.php b/includes/class-sp-install.php index 8b07e4c4..d535083f 100644 --- a/includes/class-sp-install.php +++ b/includes/class-sp-install.php @@ -409,6 +409,20 @@ class SP_Install { update_option( 'sportspress_player_show_selector', 'no' ); update_option( 'sportspress_event_performance_show_minutes', 'no' ); } + + if ( version_compare( $version, '2.1.3', '<' ) ) { + $layout = get_option( 'sportspress_player_template_order' ); + if ( is_array( $layout ) ) { + array_unshift( $layout, 'selector' ); + update_option( 'sportspress_player_template_order', $layout ); + } + + $layout = get_option( 'sportspress_staff_template_order' ); + if ( is_array( $layout ) ) { + array_unshift( $layout, 'selector' ); + update_option( 'sportspress_staff_template_order', $layout ); + } + } } /**