From 685cdb63ef21abaa132bedc67830056fc4d2fc8b Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 7 Nov 2016 18:22:01 +1100 Subject: [PATCH] Fix activation error on older versions of PHP --- includes/admin/settings/class-sp-settings-page.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/admin/settings/class-sp-settings-page.php b/includes/admin/settings/class-sp-settings-page.php index d2ea75d8..0df1811e 100644 --- a/includes/admin/settings/class-sp-settings-page.php +++ b/includes/admin/settings/class-sp-settings-page.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin - * @version 2.1.6 + * @version 2.1.7 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -70,7 +70,8 @@ class SP_Settings_Page { if ( $current_section ) do_action( 'sportspress_update_options_' . $this->template . '_' . $current_section ); - if ( ! empty( $this->templates() ) ) + $templates = $this->templates(); + if ( ! empty( $templates ) ) update_option( 'sportspress_' . $this->template . '_template_order', sp_array_value( $_POST, 'sportspress_' . $this->template . '_template_order', false ) ); if ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) { @@ -92,7 +93,8 @@ class SP_Settings_Page { * @return void */ public function layout_setting() { - $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $this->templates() ); + $templates = $this->templates(); + $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' ); if ( false === $layout ) { @@ -145,7 +147,8 @@ class SP_Settings_Page { * @return void */ public function tabs_setting() { - $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $this->templates() ); + $templates = $this->templates(); + $templates = apply_filters( 'sportspress_' . $this->template . '_templates', $templates ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' ); if ( false === $layout ) {