/**
  * Save settings
  */
 public function save()
 {
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     if (isset($_POST['prosports_event_teams_delimiter'])) {
         update_option('prosports_event_teams_delimiter', $_POST['prosports_event_teams_delimiter']);
     }
 }
 /**
  * Save settings
  */
 public function save()
 {
     global $current_section;
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     if ($current_section) {
         do_action('prosports_update_options_' . $this->id . '_' . $current_section);
     }
 }
 /**
  * Save settings
  */
 public function save()
 {
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     update_option('sportspress_header_sponsor_width', (int) sp_array_value($_POST, 'sportspress_header_sponsor_width', 128));
     update_option('sportspress_header_sponsor_height', (int) sp_array_value($_POST, 'sportspress_header_sponsor_height', 64));
     update_option('sportspress_header_sponsors_top', (int) sp_array_value($_POST, 'sportspress_header_sponsors_top', 10));
     update_option('sportspress_header_sponsors_right', (int) sp_array_value($_POST, 'sportspress_header_sponsors_right', 10));
     update_option('sportspress_footer_sponsor_width', (int) sp_array_value($_POST, 'sportspress_footer_sponsor_width', 256));
     update_option('sportspress_footer_sponsor_height', (int) sp_array_value($_POST, 'sportspress_footer_sponsor_height', 128));
 }
 /**
  * Save settings
  */
 public function save()
 {
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     if (isset($_POST['sp_branding_icon_removed'])) {
         delete_option('prosports_branding_icon');
     }
     update_option('prosports_enable_branding_css', isset($_POST['prosports_enable_branding_css']) ? 'yes' : 'no');
     if (isset($_POST['prosports_branding_css_base'])) {
         // Save settings
         $base = !empty($_POST['prosports_branding_css_base']) ? sp_format_hex($_POST['prosports_branding_css_base']) : '';
         $highlight = !empty($_POST['prosports_branding_css_highlight']) ? sp_format_hex($_POST['prosports_branding_css_highlight']) : '';
         $notifications = !empty($_POST['prosports_branding_css_notifications']) ? sp_format_hex($_POST['prosports_branding_css_notifications']) : '';
         $actions = !empty($_POST['prosports_branding_css_actions']) ? sp_format_hex($_POST['prosports_branding_css_actions']) : '';
         $text = !empty($_POST['prosports_branding_css_text']) ? sp_format_hex($_POST['prosports_branding_css_text']) : '';
         $colors = array('base' => $base, 'highlight' => $highlight, 'notifications' => $notifications, 'actions' => $actions, 'text' => $text);
         update_option('prosports_branding_css_colors', $colors);
     }
 }
 /**
  * Save settings
  */
 public function save()
 {
     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);
     }
     if (isset($_POST['add_sample_data'])) {
         SP_Admin_Sample_Data::delete_posts();
         SP_Admin_Sample_Data::insert_posts();
     }
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     // Map UTC+- timezones to gmt_offsets and set timezone_string to empty.
     if (!empty($_POST['timezone_string']) && preg_match('/^UTC[+-]/', $_POST['timezone_string'])) {
         $_POST['gmt_offset'] = $_POST['timezone_string'];
         $_POST['gmt_offset'] = preg_replace('/UTC\\+?/', '', $_POST['gmt_offset']);
         $_POST['timezone_string'] = '';
     }
     if (isset($_POST['timezone_string'])) {
         update_option('timezone_string', $_POST['timezone_string']);
     }
     if (isset($_POST['gmt_offset'])) {
         update_option('gmt_offset', $_POST['gmt_offset']);
     }
     if (isset($_POST['sportspress_frontend_css_primary'])) {
         // Save settings
         $primary = !empty($_POST['sportspress_frontend_css_primary']) ? sp_format_hex($_POST['sportspress_frontend_css_primary']) : '';
         $background = !empty($_POST['sportspress_frontend_css_background']) ? sp_format_hex($_POST['sportspress_frontend_css_background']) : '';
         $text = !empty($_POST['sportspress_frontend_css_text']) ? sp_format_hex($_POST['sportspress_frontend_css_text']) : '';
         $heading = !empty($_POST['sportspress_frontend_css_heading']) ? sp_format_hex($_POST['sportspress_frontend_css_heading']) : '';
         $link = !empty($_POST['sportspress_frontend_css_link']) ? sp_format_hex($_POST['sportspress_frontend_css_link']) : '';
         $customize = !empty($_POST['sportspress_frontend_css_customize']) ? 1 : '';
         $colors = array('primary' => $primary, 'background' => $background, 'text' => $text, 'heading' => $heading, 'link' => $link, 'customize' => $customize);
         // Merge with existing options if available
         $options = get_option('themeboy');
         if (is_array($options)) {
             $colors = array_merge($options, $colors);
         }
         update_option('themeboy', $colors);
     }
 }
 /**
  * Save settings
  */
 public function save()
 {
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     if (isset($_POST['sportspress_league_menu_teams'])) {
         $teams = $_POST['sportspress_league_menu_teams'];
     } else {
         $teams = array();
     }
     update_option('sportspress_league_menu_teams', $teams);
     if (isset($_POST['sp_league_menu_logo_removed'])) {
         delete_option('sportspress_league_menu_logo');
     }
     update_option('sportspress_league_menu_logo_width', sp_array_value($_POST, 'sportspress_league_menu_logo_width', 64));
     update_option('sportspress_league_menu_logo_height', sp_array_value($_POST, 'sportspress_league_menu_logo_height', 32));
     update_option('sportspress_league_menu_logo_bottom', sp_array_value($_POST, 'sportspress_league_menu_logo_bottom', 0));
     update_option('sportspress_league_menu_logo_left', sp_array_value($_POST, 'sportspress_league_menu_logo_left', 0));
     update_option('sportspress_league_menu_team_width', sp_array_value($_POST, 'sportspress_league_menu_team_width', 32));
     update_option('sportspress_league_menu_team_height', sp_array_value($_POST, 'sportspress_league_menu_team_height', 32));
 }
 /**
  * Save settings
  */
 public function save()
 {
     global $current_section;
     $settings = $this->get_settings();
     SP_Admin_Settings::save_fields($settings);
     if ($current_section) {
         do_action('sportspress_update_options_' . $this->template . '_' . $current_section);
     }
     if (!empty($this->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'])) {
         foreach ($_POST['sportspress_template_visibility'] as $option => $toggled) {
             if ($toggled) {
                 update_option($option, 'yes');
             } else {
                 update_option($option, 'no');
             }
         }
     }
 }