From 67522f77762d7d753a161fb2a1707509952c5cfc Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 31 Mar 2014 23:45:26 +1100 Subject: [PATCH] Update default colour scheme --- includes/class-sp-install.php | 20 +++++++++++++++----- includes/sp-template-hooks.php | 28 ---------------------------- uninstall.php | 2 ++ 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/includes/class-sp-install.php b/includes/class-sp-install.php index d5d75062..7557e977 100644 --- a/includes/class-sp-install.php +++ b/includes/class-sp-install.php @@ -125,11 +125,21 @@ class SP_Install { } } - // Configure default sport - $sport = 'soccer'; - $options = sp_get_sport_presets(); - SP_Admin_Settings::configure_sport( $options[ $sport ] ); - update_option( 'sportspress_sport', $sport ); + // Default color scheme + add_option( 'sportspress_frontend_css_primary', '#00a69c' ); + add_option( 'sportspress_frontend_css_heading', '#ffffff' ); + add_option( 'sportspress_frontend_css_text', '#222222' ); + add_option( 'sportspress_frontend_css_background', '#f5f5f5' ); + add_option( 'sportspress_frontend_css_alternate', '#f0f0f0' ); + + if ( ! get_option( 'sportspress_installed' ) ) { + // Configure default sport + $sport = 'soccer'; + $options = sp_get_sport_presets(); + SP_Admin_Settings::configure_sport( $options[ $sport ] ); + update_option( 'sportspress_sport', $sport ); + update_option( 'sportspress_installed', 1 ); + } } /** diff --git a/includes/sp-template-hooks.php b/includes/sp-template-hooks.php index 8a3cca67..e0ecd6e9 100644 --- a/includes/sp-template-hooks.php +++ b/includes/sp-template-hooks.php @@ -44,34 +44,6 @@ function sportspress_the_title( $title, $id ) { } add_filter( 'the_title', 'sportspress_the_title', 10, 2 ); -function sportspress_admin_notices_styles() { - $screen = get_current_screen(); - - if ( $screen->id != 'settings_page_sportspress' ): - if ( isset( $_REQUEST['skip_install_sportspress'] ) ): - update_option( '_sp_needs_welcome', $_REQUEST['_sp_needs_welcome'] ); - endif; - - if ( ! get_option( 'sportspress_installed' ) ): - add_action( 'admin_notices', 'sportspress_admin_install_notices' ); - endif; - endif; - - $template = get_option( 'template' ); - - if ( ! current_theme_supports( 'sportspress' ) && ! in_array( $template, array( 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ): - if ( ! empty( $_GET['hide_sportspress_theme_support_check'] ) ): - update_option( 'sportspress_theme_support_check', $template ); - return; - endif; - - if ( get_option( 'sportspress_theme_support_check' ) !== $template ): - add_action( 'admin_notices', 'sportspress_theme_check_notice' ); - endif; - endif; -} -//add_action( 'admin_print_styles', 'sportspress_admin_notices_styles' ); - /** * sportspress_admin_install_notices function. * diff --git a/uninstall.php b/uninstall.php index 5a047400..9bd0cbb0 100644 --- a/uninstall.php +++ b/uninstall.php @@ -22,3 +22,5 @@ $installer->remove_roles(); // Delete options $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'sportspress_%';"); + +delete_option( 'sportspress_installed' ); \ No newline at end of file