Stricter conditionals for overriding sport preset
This commit is contained in:
@@ -335,7 +335,7 @@ class SP_Admin_Welcome {
|
||||
$settings = array(
|
||||
array(
|
||||
'id' => 'sportspress_sport',
|
||||
'default' => 'custom',
|
||||
'default' => get_option( 'sportspress_sport', 'custom' ),
|
||||
'type' => 'sport',
|
||||
'title' => __( 'Sport', 'sportspress' ),
|
||||
'welcome' => true,
|
||||
|
||||
@@ -191,7 +191,7 @@ class SP_Settings_General extends SP_Settings_Page {
|
||||
* Save settings
|
||||
*/
|
||||
public function save() {
|
||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) !== $_POST['sportspress_sport'] ):
|
||||
$sport = $_POST['sportspress_sport'];
|
||||
SP_Admin_Sports::apply_preset( $sport );
|
||||
update_option( '_sp_needs_welcome', 0 );
|
||||
|
||||
Reference in New Issue
Block a user