Fix activation error on older versions of PHP

This commit is contained in:
Brian Miyaji
2016-11-07 18:22:01 +11:00
parent afb918a134
commit 685cdb63ef

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy * @author ThemeBoy
* @category Admin * @category Admin
* @package SportsPress/Admin * @package SportsPress/Admin
* @version 2.1.6 * @version 2.1.7
*/ */
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -70,7 +70,8 @@ class SP_Settings_Page {
if ( $current_section ) if ( $current_section )
do_action( 'sportspress_update_options_' . $this->template . '_' . $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 ) ); 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'] ) ) { if ( isset( $_POST['sportspress_template_visibility'] ) && is_array( $_POST['sportspress_template_visibility'] ) ) {
@@ -92,7 +93,8 @@ class SP_Settings_Page {
* @return void * @return void
*/ */
public function layout_setting() { 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' ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' );
if ( false === $layout ) { if ( false === $layout ) {
@@ -145,7 +147,8 @@ class SP_Settings_Page {
* @return void * @return void
*/ */
public function tabs_setting() { 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' ); $layout = get_option( 'sportspress_' . $this->template . '_template_order' );
if ( false === $layout ) { if ( false === $layout ) {